#include IRrecv irAlici(2); decode_results tus; #define tus1a 0x6DB32A6A #define tus1b 0xCCDA2767 #define tus2a 0x59C5D2A8 #define tus2b 0xE0C77F29 #define tus3a 0x4BCA9BB0 #define tus3b 0x54428375 const byte LED[] = {3, 4, 5}; void setup() { Serial.begin(9600); irAlici.enableIRIn(); pinMode(LED[0], OUTPUT); pinMode(LED[1], OUTPUT); pinMode(LED[2], OUTPUT); } void loop() { if (irAlici.decode(&tus)) { Serial.println(tus.value, HEX); if (tus.value == tus1a) digitalWrite( LED[0], HIGH); else if (tus.value == tus1b) digitalWrite( LED[0], LOW); else if (tus.value == tus2a) digitalWrite( LED[1], HIGH); else if (tus.value == tus2b) digitalWrite( LED[1], LOW); else if (tus.value == tus3a) digitalWrite( LED[2], HIGH); else if (tus.value == tus3b) digitalWrite( LED[2], LOW); irAlici.resume(); } }