Created
November 19, 2018 13:23
-
-
Save lingmujianshi/7813525b00fa69a10af3f14899e8f596 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
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