Skip to content

Instantly share code, notes, and snippets.

@lingmujianshi
Created November 19, 2018 13:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lingmujianshi/7813525b00fa69a10af3f14899e8f596 to your computer and use it in GitHub Desktop.
Save lingmujianshi/7813525b00fa69a10af3f14899e8f596 to your computer and use it in GitHub Desktop.
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
Serial.begin(9600);
Serial.println("Enabling IRin");
irrecv.enableIRIn(); // Start the receiver
Serial.println("Enabled IRin");
}
void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);
irrecv.resume(); // Receive the next value
}
delay(100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment