Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <IRremote.h>
- int RECV_PIN = 11;
- int LED = 2;
- bool LED_ON = false;
- const long IRResult = 0xFFA25D;
- IRrecv irrecv(RECV_PIN);
- decode_results results;
- void setup()
- {
- Serial.begin(9600);
- pinMode(RECV_PIN, INPUT);
- pinMode(LED, OUTPUT);
- irrecv.enableIRIn();
- }
- void loop()
- {
- if (irrecv.decode(&results))
- {
- Serial.println(results.value, HEX);
- irrecv.resume();
- if(results.value == IRResult)
- LED_ON = !LED_ON;
- }
- digitalWrite(LED, LED_ON);
- delay(100);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement