Code: Select all
#include <IRremote.h>
int bright;
int before;
int out=11; //connect your LED to pin 11
int groen=12: //Green LED?
int steps=5; //dimmer steps, vary those to increase/decrease the steps between full brightness and turned off
int RECV_PIN = 3; //data out of IR receiver connects to pin 11
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup(){
irrecv.enableIRIn(); // start the receiver
before=0; //LED is turned off
bright=255; //brightness value is at maximum (255)
pinMode(out,OUTPUT);
pinMode(groen,OUTPUT);
}
void loop() {
if (irrecv.decode(&results)) {
if (results.value==0xFFA25D){ //Code to turn the LED ON/OFF
if(before==0){ // if the LED was turned off, then we turn it on
digitalWrite(out,HIGH);
before=1; //LED is now turned on
}
else{
digitalWrite(out,LOW); //if the LED was turned on, then we turn it off
before=0;
bright=255;
}}
if (results.value==0xFF22DD){ //Code to turn the LED ON/OFF
if(before==0){ // if the LED was turned off, then we turn it on
digitalWrite(groen,HIGH);
before=1; //LED is now turned on
}
else{
digitalWrite(groen,LOW); //if the LED was turned on, then we turn it off
before=0;
bright=255;
}}
irrecv.resume();
}}
FZ2EI5HI4MMQYGL.ino:8:13: error: expected ',' or ';' before ':' token