Created
October 23, 2014 15:57
-
-
Save nilsonpessim/01f0eee14199232b386c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <IRremote.h> | |
int RECV_PIN = 2; | |
int Led = 13; | |
IRrecv irrecv(RECV_PIN); | |
decode_results results; | |
void setup() | |
{ | |
Serial.begin(9600); | |
pinMode (Led,OUTPUT); | |
irrecv.enableIRIn(); | |
} | |
void loop() { | |
if (irrecv.decode(&results)) { | |
Serial.println(results.value, HEX); | |
if(results.value == 0x1FE7887){ | |
digitalWrite(Led, HIGH); | |
} | |
if(results.value == 0x1FE48B7){ | |
digitalWrite(Led, LOW); | |
} | |
irrecv.resume(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment