// 513Mhz light sockets
#define TX_PIN 12
#define LED_PIN 13
+#define LED_ON digitalWrite(LED_PIN, HIGH);
+#define LED_OFF digitalWrite(LED_PIN, LOW);
int int_0 = 300; // ms
int int_1 = 900; // ms
int wait = 2000; // ms
-int repeat = 10; // times (5 times seem a little low for sensors which are more than 10m away)
+int repeat = 20; // times (5 times seem a little low for sensors which are more than 10m away)
void send_513(char *code) {
Serial.print("send 513Mhz ");
delayMicroseconds(i2);
}
+ digitalWrite(LED_PIN, LOW);
+
delayMicroseconds(wait); // guess
}
- digitalWrite(LED_PIN, LOW);
}
Serial.readBytesUntil('\n', binary_data, sizeof(binary_data));
Serial.print("# send B");
Serial.println( binary_data );
+ LED_ON
mySwitch.send( binary_data );
+ LED_OFF
} else
// light sockets at 513 Mhz
byte on = serial_data[1];
+ LED_ON
+
// switches, 433 Mhz set of 3
switch ( serial_data[0] ) {
case 1:
Serial.println(serial_data[0], DEC);
}
+ LED_OFF
+
// reset for later
serial_pos = 0;
}