projects
/
Arduino
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d32321c
)
send user-defined 26 bit codes
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Wed, 17 Dec 2014 16:45:16 +0000
(17:45 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Wed, 17 Dec 2014 16:45:16 +0000
(17:45 +0100)
light_sockets/light_sockets.ino
patch
|
blob
|
history
diff --git
a/light_sockets/light_sockets.ino
b/light_sockets/light_sockets.ino
index
85818e0
..
c0ad002
100644
(file)
--- 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
int wait = 2000; // ms
int repeat = 5; // times
+char code[27]; // 26 bits + null
+
void setup() {
pinMode(LED_PIN, OUTPUT);
pinMode(TX_PIN, OUTPUT);
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("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);
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);
} else {
Serial.print("ignored ");
Serial.println(in);