mirror of
https://bitbucket.org/myhomie/mycorerepository.git
synced 2025-12-06 17:51:20 +00:00
21 lines
404 B
C++
21 lines
404 B
C++
#include <IRremoteESP8266.h>
|
|
|
|
int RECV_PIN = 2; //an IR detector/demodulatord is connected to GPIO pin 2
|
|
|
|
IRrecv irrecv(RECV_PIN);
|
|
decode_results results;
|
|
|
|
void setup()
|
|
{
|
|
Serial.begin(9600);
|
|
irrecv.enableIRIn(); // Start the receiver
|
|
}
|
|
|
|
void loop() {
|
|
if (irrecv.decode(&results)) {
|
|
// Print value
|
|
Serial.println(results.value, HEX);
|
|
irrecv.resume(); // Receive the next value
|
|
}
|
|
}
|