标签:ble lse out resume 红外遥控 remote receiver put The
#include <IRremote.h> int RECV_PIN = 11; int LED_PIN = 2; IRrecv irrecv(RECV_PIN); decode_results results; void setup() { Serial.begin(9600); irrecv.enableIRIn(); // Start the receiver pinMode(LED_PIN, OUTPUT); digitalWrite(LED_PIN, HIGH); } void loop() { if (irrecv.decode(&results)) { Serial.println(results.value, HEX); if (results.value == 0xFFA25D) //开灯的值 { digitalWrite(LED_PIN, LOW); } else if (results.value == 0xFF629D) //关灯的值 { digitalWrite(LED_PIN, HIGH); } irrecv.resume(); // Receive the next value } delay(100); }
红外接收器
标签:ble lse out resume 红外遥控 remote receiver put The
原文地址:https://www.cnblogs.com/Sonny-xby/p/11083480.html