код из видео..
#include <IRremote.h> #define RECV_PIN 14 // IR приемник #define KEY1 0x40BFA05F // кнопки пульта ДУ #define KEY2 0x40BF609F #define KEY3 0x40BFE01F #define KEY4 0x40BF906F #define KEY5 0x40BF50AF #define KEY6 0x40BFD02F #define KEY7 0x40BFB04F #define KEY8 0x40BF708F #define POWER_KEY 0x40BF30CF #define OUT_A 2 // выходы на шилд #define OUT_B 3 #define OUT_C 4 #define OUT_D 5 #define OUT_E 6 #define OUT_F 7 #define OUT_G 8 #define OUT_H 9 #define LED 10 IRrecv irrecv(RECV_PIN); decode_results results; void setup() { pinMode(OUT_A, OUTPUT); pinMode(OUT_B, OUTPUT); pinMode(OUT_C, OUTPUT); pinMode(OUT_D, OUTPUT); pinMode(OUT_E, OUTPUT); pinMode(OUT_F, OUTPUT); pinMode(OUT_G, OUTPUT); pinMode(OUT_H, OUTPUT); pinMode(LED, OUTPUT); irrecv.enableIRIn(); // Start the receiver digitalWrite(LED, HIGH); delay(100); digitalWrite(LED, LOW); } void loop() { if (irrecv.decode(&results)) { if (results.value == KEY1) digitalWrite(OUT_A, !digitalRead(OUT_A)); else if (results.value == KEY2) digitalWrite(OUT_B, !digitalRead(OUT_B)); else if (results.value == KEY3) digitalWrite(OUT_C, !digitalRead(OUT_C)); else if (results.value == KEY4) digitalWrite(OUT_D, !digitalRead(OUT_D)); else if (results.value == KEY5) digitalWrite(OUT_E, !digitalRead(OUT_E)); else if (results.value == KEY6) digitalWrite(OUT_F, !digitalRead(OUT_F)); else if (results.value == KEY7) digitalWrite(OUT_G, !digitalRead(OUT_G)); else if (results.value == KEY8) digitalWrite(OUT_H, !digitalRead(OUT_H)); else if (results.value == POWER_KEY) { if (digitalRead(OUT_A) || digitalRead(OUT_B) || digitalRead(OUT_C) || digitalRead(OUT_D) || digitalRead(OUT_E) || digitalRead(OUT_F) || digitalRead(OUT_G) || digitalRead(OUT_H) ) { digitalWrite(OUT_A, LOW); digitalWrite(OUT_B, LOW); digitalWrite(OUT_C, LOW); digitalWrite(OUT_D, LOW); digitalWrite(OUT_E, LOW); digitalWrite(OUT_F, LOW); digitalWrite(OUT_G, LOW); digitalWrite(OUT_H, LOW); } else { digitalWrite(OUT_A, HIGH); digitalWrite(OUT_B, HIGH); digitalWrite(OUT_C, HIGH); digitalWrite(OUT_D, HIGH); digitalWrite(OUT_E, HIGH); digitalWrite(OUT_F, HIGH); digitalWrite(OUT_G, HIGH); digitalWrite(OUT_H, HIGH); } } irrecv.resume(); } }