Advertisement
adduxa

Microlab Solo 6C IR control on Arduino

Jan 29th, 2015
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.99 KB | None | 0 0
  1. //IR controlling for Microlab Solo 6C
  2. //
  3. //Created by adduxa
  4. //Thanks to http://ex.uz/2013/09/microlab-remote-control-s4/
  5. //
  6. //Connect IR led's "+" to pin 3 on Arduino (it can not be reassigned)
  7.  
  8. #include <IRremote.h>
  9.  
  10. IRsend irsend;
  11.  
  12. int inByte;
  13.  
  14. void setup()
  15. {
  16.   Serial.begin(9600);
  17. }
  18.  
  19. void loop() {
  20.   if (Serial.available() > 0) {
  21.     inByte = Serial.read() - 48;
  22.     switch(inByte) {
  23.       case 1: irsend.sendNEC(0x807F8877, 32); break;  //v+
  24.       case 2: irsend.sendNEC(0x807F08F7, 32); break;  //v-
  25.       case 3: irsend.sendNEC(0x807F906F, 32); break;  //t+
  26.       case 4: irsend.sendNEC(0x807FB04F, 32); break;  //t-
  27.       case 5: irsend.sendNEC(0x807F50AF, 32); break;  //b+
  28.       case 6: irsend.sendNEC(0x807F708F, 32); break;  //b-
  29.       case 7: irsend.sendNEC(0x807F10EF, 32); break;  //reset
  30.       case 8: irsend.sendNEC(0x807F20DF, 32); break;  //input
  31.       case 9: irsend.sendNEC(0x807F40BF, 32); break;  //mute
  32.       default: Serial.println("What?!");
  33.     }
  34.   }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement