Revision 294
updated to use TT_GRANT instead of deprecated TT_ON, and also updated test/main.c to use majority and call parse_packet
main.c | ||
---|---|---|
42 | 42 |
/* #define OFF 0x00 */ |
43 | 43 |
|
44 | 44 |
/***** change ADDR ****/ |
45 |
#define ADDR 14
|
|
45 |
#define ADDR 12
|
|
46 | 46 |
#define DELIM '^' |
47 | 47 |
#define SERVER 1 |
48 | 48 |
#define TURNON 'O' |
... | ... | |
76 | 76 |
|
77 | 77 |
void init_pins(void) { |
78 | 78 |
DDRB = 0x00; |
79 |
DDRB = _BV(DDB0) | _BV(DDB1) | _BV(DDB2) | _BV(DDB5);
|
|
79 |
DDRB = LED_GREEN | LED_YELLOW | LED_RED; // Set the LED pins as outputs
|
|
80 | 80 |
DDRD = _BV(DDB4); |
81 | 81 |
PORTB = 0x00; |
82 | 82 |
} |
... | ... | |
120 | 120 |
|
121 | 121 |
correct = (a == ADDR) + (b == ADDR) + (c == ADDR); |
122 | 122 |
|
123 |
if ( correct == 3 ) {
|
|
124 |
PORTB |= LED_GREEN;
|
|
123 |
if (correct == 3) {
|
|
124 |
PORTB &= ~LED_GREEN;
|
|
125 | 125 |
} |
126 | 126 |
else if(correct == 0){ |
127 |
PORTB |= LED_RED;
|
|
127 |
PORTB &= ~LED_RED;
|
|
128 | 128 |
} |
129 | 129 |
else { |
130 |
PORTB |= LED_YELLOW;
|
|
130 |
PORTB &= ~LED_YELLOW;
|
|
131 | 131 |
} |
132 | 132 |
|
133 | 133 |
|
Also available in: Unified diff