Skip to content

Instantly share code, notes, and snippets.

@nilsonpessim
Created October 23, 2014 15:57
Show Gist options
  • Save nilsonpessim/01f0eee14199232b386c to your computer and use it in GitHub Desktop.
Save nilsonpessim/01f0eee14199232b386c to your computer and use it in GitHub Desktop.
#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