Browse Source

Before can send rewrite

led
wiebel 8 years ago
parent
commit
4dea93c7d2
  1. 10
      src/CANNode.cpp

10
src/CANNode.cpp

@ -21,7 +21,7 @@
#define N_ACTIONS 64 #define N_ACTIONS 64
#define DEBUG 0 // 1 for noisy serial #define DEBUG 0 // 1 for noisy serial
#define LED 17 #define LED 13
#define RELAY1 0 #define RELAY1 0
#define RELAY2 1 #define RELAY2 1
#define RELAY3 23 #define RELAY3 23
@ -294,7 +294,7 @@ void loop(void)
while(OW_1.search(addr) == 1) { while(OW_1.search(addr) == 1) {
if ( OneWire::crc8( addr, 7) != addr[7]) { if ( OneWire::crc8( addr, 7) != addr[7]) {
Serial.print("CRC is not valid!\n"); Serial.print("CRC is not valid!\n");
delay(100); delay(10);
return; return;
} }
Serial.print("Found a device: "); Serial.print("Found a device: ");
@ -313,15 +313,15 @@ void loop(void)
} }
if (action[0]) { if (action[0]) {
Serial.print("pioA toggled"); Serial.print("pioA toggled");
digitalWrite(led, !digitalRead(led)); // digitalWrite(led, !digitalRead(led));
trig_event = switches[0].event_tag[0]; trig_event = switches[0].event_tag[0];
// might need queuing // might need queuing
event_idx = 0; event_idx = 0;
} }
if (action[1]) { if (action[1]) {
Serial.print("pioB toggled"); Serial.print("pioB toggled");
digitalWrite(led, !digitalRead(led)); // digitalWrite(led, !digitalRead(led));
trig_event= switches[0].event_tag[1]; trig_event = switches[0].event_tag[1];
event_idx = 0; event_idx = 0;
} }
} }

Loading…
Cancel
Save