Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <IRremote.h>
- const char DIN_RECEPTEUR_INFRAROUGE = 11;
- IRrecv monRecepteurInfraRouge (DIN_RECEPTEUR_INFRAROUGE);
- decode_results messageRecu;
- int RED = 10;
- int GREEN = 9;
- int BLUE = 8;
- void setup()
- {
- Serial.begin(9600);
- monRecepteurInfraRouge.enableIRIn();
- monRecepteurInfraRouge.blink13(true);
- pinMode(RED, OUTPUT);
- pinMode(GREEN, OUTPUT);
- pinMode(BLUE, OUTPUT);
- }
- void loop() {
- if (monRecepteurInfraRouge.decode(&messageRecu))
- {
- if (messageRecu.value == 0xFFE21D)
- {Serial.println("CH+");}
- if (messageRecu.value == 0xFFA25D)
- {Serial.println("CH-");}
- if (messageRecu.value == 0xFF629D)
- {Serial.println("CH");}
- if (messageRecu.value == 0xFF22DD)
- {Serial.println("<<");}
- if (messageRecu.value == 0xFF02FD)
- {Serial.println(">>");}
- if (messageRecu.value == 0xFFC23D)
- {Serial.println(">||");}
- if (messageRecu.value == 0xFFE01F)
- {Serial.println("-");}
- if (messageRecu.value == 0xFFA857)
- {Serial.println("+");}
- if (messageRecu.value == 0xFF906F)
- {Serial.println("EQ");}
- if (messageRecu.value == 0xFF6897)
- {Serial.println("0");}
- if (messageRecu.value == 0xFF9867)
- {Serial.println("100+");}
- if (messageRecu.value == 0xFFB04F)
- {Serial.println("200+");}
- if (messageRecu.value == 0xFF30CF)
- {Serial.println("1");}
- if (messageRecu.value == 0xFF18E7)
- {Serial.println("2");}
- if (messageRecu.value == 0xFF7A85)
- {Serial.println("3");}
- if (messageRecu.value == 0xFF10EF)
- {Serial.println("4");}
- if (messageRecu.value == 0xFF38C7)
- {Serial.println("5");}
- if (messageRecu.value == 0xFF5AA5)
- {Serial.println("6");}
- if (messageRecu.value == 0xFF42BD)
- {Serial.println("7");}
- if (messageRecu.value == 0xFF4AB5)
- {Serial.println("8");}
- if (messageRecu.value == 0xFF52AD)
- {Serial.println("9");}
- delay(500);
- monRecepteurInfraRouge.resume();
- }
- delay(1);
- }
- void setColor(int red, int green, int blue)
- {
- #ifdef COMMON_ANODE
- red = 255 - red;
- green = 255 - green;
- blue = 255 - blue;
- #endif
- analogWrite(RED, red);
- analogWrite(GREEN, green);
- analogWrite(BLUE, blue);
- }
Advertisement
Add Comment
Please, Sign In to add comment