mirror of
https://github.com/Lapikud/Viido.git
synced 2026-03-23 13:14:19 +00:00
add arduino code
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -99,3 +99,5 @@ ENV/
|
||||
|
||||
# mypy
|
||||
.mypy_cache/
|
||||
|
||||
.idea/
|
||||
|
||||
37
arduino_remote/arduino_remote.ino
Normal file
37
arduino_remote/arduino_remote.ino
Normal file
@@ -0,0 +1,37 @@
|
||||
#include <IRLibAll.h>
|
||||
|
||||
IRsend mySender;
|
||||
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
char c = Serial.read();
|
||||
if (c != -1) {
|
||||
switch (c) {
|
||||
case 'm':
|
||||
mySender.send(NEC,0x4BB6906F, 32); // TV/CD
|
||||
break;
|
||||
case 'r':
|
||||
mySender.send(NEC,0x4B36D32C, 32); // on-off
|
||||
break;
|
||||
case 't':
|
||||
mySender.send(NEC,0x4B3631CE, 32); // BD/DVD
|
||||
break;
|
||||
case 'l':
|
||||
mySender.send(NEC,0x4BB6B04F, 32); // game
|
||||
break;
|
||||
case 'q':
|
||||
mySender.send(NEC,0x4BB640BF, 32); // vol +
|
||||
break;
|
||||
case 'w':
|
||||
mySender.send(NEC,0x4BB6C03F, 32); // vol -
|
||||
break;
|
||||
case 'a':
|
||||
mySender.send(NEC,0x4BB6F906, 32); // aux
|
||||
break;
|
||||
}
|
||||
Serial.write(c);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user