Revision 11c945d9 paintboard/code/main.c

View differences:

paintboard/code/main.c
2 2
#include "motor.h"
3 3
#include "servo.h"
4 4
#include "sol.h"
5
#include "geiger.h"
5 6
#include <avr/io.h>
6 7
#include <avr/interrupt.h>
7 8
#include <util/delay.h>
......
101 102
  twi_attachSlaveTxEvent(slave_tx);
102 103
  twi_setAddress(TRACKING_ID);
103 104
  twi_init();
105
  geiger_init();
104 106
  motor_init();
105 107
  servo_init();
106 108
  while (1)
107 109
  {
110
    geiger_tick();
111
    internal_data[PAINT_INPUT_2] = geiger_rate();
108 112
    internal_data[PAINT_INPUT_1] = !(!(_BV(METAL_DETECT) & PIND));
109 113
    if (internal_data[PAINT_INPUT_1]) {
110 114
      set_servo1(-128);
......
116 120
      set_motor2(127);
117 121
    }
118 122
    servo_pulse();
119
    /* TODO geiger counter */
120 123
    _delay_ms(20);
121 124
  }
122 125
  return 0;

Also available in: Unified diff