X-Git-Url: http://git.rot13.org/?p=Arduino;a=blobdiff_plain;f=light_sockets%2Flight_sockets.ino;fp=light_sockets%2Flight_sockets.ino;h=c0ad002c5ed9214b7dd5893644de08be6cb363cf;hp=85818e059b07cc7582448f10073953e20ebb5f8c;hb=2e7750cc773dbe5e59eed33dc32e76d7811d1082;hpb=d32321c95447131331685af0bab69f9ca99c9d25 diff --git a/light_sockets/light_sockets.ino b/light_sockets/light_sockets.ino index 85818e0..c0ad002 100644 --- a/light_sockets/light_sockets.ino +++ b/light_sockets/light_sockets.ino @@ -15,6 +15,8 @@ int int_1 = 900; // ms int wait = 2000; // ms int repeat = 5; // times +char code[27]; // 26 bits + null + void setup() { pinMode(LED_PIN, OUTPUT); pinMode(TX_PIN, OUTPUT); @@ -25,6 +27,7 @@ void setup() { Serial.println("w/s - 1 inteval +/- 100 ms"); Serial.println("e/d - wait +/- 100 ms"); Serial.println("r/f - repeat +/- 1"); + Serial.println("U1000100110110000000000010 - send 26 bit user code"); } @@ -100,6 +103,12 @@ void loop() { Serial.print("repeat = "); Serial.println(repeat); + } else if (in == 'U') { + Serial.readBytesUntil('\n', code, sizeof(code)); + Serial.print('U'); + Serial.println( code ); + send( code ); + } else { Serial.print("ignored "); Serial.println(in);