Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <IRremote.h>
- IRsend irsend;
- int cmd;
- void setup() {
- Serial.begin(9600);
- Serial.setTimeout(20);
- }
- void loop() {
- cmd =-1;
- if(Serial.available())
- {
- cmd = Serial.parseInt();
- switch (cmd) {
- case 0:psd();
- break;
- case 1:avol();
- break;
- case 2:mvol();
- break;
- case 3:pwr();
- break;
- case 4:ach();
- break;
- case 5:mch();
- break;
- case 6:_1();
- break;
- case 7:_2();
- break;
- case 8:_3();
- break;
- case 9:_4();
- break;
- case 10:_5();
- break;
- case 11:_6();
- break;
- case 12:_7();
- break;
- case 13:_8();
- break;
- case 14:_9();
- break;
- case 15:_0();
- break;
- case 16:ext();
- break;
- case 17:menu();
- break;
- case 18:green();
- break;
- case 19:list();
- break;
- }
- Serial.println(cmd);
- }
- }
- void psd()
- {
- irsend.sendNEC(0xFFFFFFFF, 32);
- }
- void avol()
- {
- irsend.sendNEC(0x828D7, 32);
- }
- void mvol()
- {
- irsend.sendNEC(0x848B7, 32);
- }
- void pwr()
- {
- irsend.sendNEC(0x800FF, 32);
- }
- void ach()
- {
- irsend.sendNEC(0x88877, 32);
- }
- void mch()
- {
- irsend.sendNEC(0x8A857, 32);
- }
- void _1()
- {
- irsend.sendNEC(0x8C03F, 32);
- }
- void _2()
- {
- irsend.sendNEC(0x820DF, 32);
- }
- void _3()
- {
- irsend.sendNEC(0x8A05F, 32);
- }
- void _4()
- {
- irsend.sendNEC(0x8609F, 32);
- }
- void _5()
- {
- irsend.sendNEC(0x8E01F, 32);
- }
- void _6()
- {
- irsend.sendNEC(0x810EF, 32);
- }
- void _7()
- {
- irsend.sendNEC(0x8906F, 32);
- }
- void _8()
- {
- irsend.sendNEC(0x850AF, 32);
- }
- void _9()
- {
- irsend.sendNEC(0x8D02F, 32);
- }
- void _0()
- {
- irsend.sendNEC(0x830CF, 32);
- }
- void ext()
- {
- irsend.sendNEC(0x86897, 32);
- }
- void menu()
- {
- irsend.sendNEC(0x8708F, 32);
- }
- void green()
- {
- irsend.sendNEC(0x8B847, 32);
- }
- void list()
- {
- irsend.sendNEC(0x8D827, 32);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement