Revision d9b50611 paintboard/code/main.c

View differences:

paintboard/code/main.c
4 4
#include "sol.h"
5 5
#include <avr/io.h>
6 6
#include <avr/interrupt.h>
7
#include <util/delay.h>
7 8

  
8 9
#define TRACKING_ID 0x43
9 10
#define SERIAL_NUMBER 0x12
......
26 27

  
27 28
#define PAINT_DATA_LEN         13
28 29

  
29
#define METAL_DETECT           PD4
30
#define METAL_DETECT           PD5
30 31

  
31 32
uint8_t internal_index = 0;
32 33
uint8_t internal_data[PAINT_DATA_LEN] = {
......
105 106
  while (1)
106 107
  {
107 108
    internal_data[PAINT_INPUT_1] = !(!(_BV(METAL_DETECT) & PIND));
109
    if (internal_data[PAINT_INPUT_1]) {
110
      set_servo1(-128);
111
    } else {
112
      set_servo1(127);
113
    }
114
    servo_pulse();
108 115
    /* TODO geiger counter */
116
    _delay_ms(20);
109 117
  }
110 118
  return 0;
111 119
}

Also available in: Unified diff