код из видео
#include <IRLib.h> #define LED_PIN 1 #define IR_RX_PIN 0 #define BUTTON1 0xFF02FD #define BUTTON2 0x62E9 IRrecv My_Receiver(IR_RX_PIN); IRdecode My_Decoder; void setup() { My_Receiver.enableIRIn(); // Start the receiver pinMode(LED_PIN, OUTPUT); digitalWrite(LED_PIN, HIGH); } void loop() { if(My_Receiver.GetResults(&My_Decoder)) { My_Decoder.decode(); if (My_Decoder.value == BUTTON1 || My_Decoder.value == BUTTON2) { digitalWrite(LED_PIN, !digitalRead(LED_PIN)); } My_Receiver.resume(); } }