📅  最后修改于: 2022-03-11 14:44:57.324000             🧑  作者: Mango
#include
int RECV_PIN = D4; //an IR detector connected to D4
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}
void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);
irrecv.resume(); // Receive the next value
}
delay(100);
}