#include // Pin constants #define IR_RECIEVER_PIN 11 // Variables to get this thing work IRrecv ir(IR_RECIEVER_PIN); int sayi=0; bool cihazAcik = false; int Red = 3; int Green = 5; int Blue = 6; void setup() { Serial.begin(9600); ir.enableIRIn(); pinMode(3,OUTPUT); pinMode(Red, OUTPUT); pinMode(Green, OUTPUT); pinMode(Blue, OUTPUT); } void loop() { if (ir.decode()) { long deger=ir.decodedIRData.command; ir.resume(); Serial.println(deger); if (deger==0) cihazAcik = !cihazAcik; if (deger==12) sayi=0; else if (deger==16)sayi=1; else if (deger==17)sayi=2; else if (deger==18)sayi=3; else if (deger==20)sayi=4; else if (deger==21)sayi=5; else if (deger==22)sayi=6; else if (deger==24)sayi=7; else if (deger==25)sayi=8; else if (deger==26)sayi=9; else if (deger==8&&sayi>0)sayi--; else if (deger==10&&sayi<9)sayi++; if(deger==12) for (int i=0;i<=255;i++) { // Kırmızıdan Yeşile Geçiş analogWrite(Red,(255-i)); analogWrite(Green, i); delay(1); } else if(deger==16) for (int i=0;i<=255;i++) { // Yeşilden Maviye Geçiş analogWrite(Green,(255-i)); analogWrite(Blue, i); delay(1); } else if(deger==17) for (int i=0;i<=255;i++) { // Maviden Kırmızıya Geçiş analogWrite(Blue,(255-i)); analogWrite(Red, i); delay(1); } } }