Hi
Im new to arduino, Im also working on same theme but with a diff code, the code works but the result is nor stable
can any one help
Im trying to switch on and off an led with a same button, Im using a sony remote
#include <IRremote.h>
int LED1 = 13;
int on = 0;
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}
void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value, DEC);
irrecv.resume(); // Receive the next value
}
switch(results.value)
{
case 16:
{
on = !on;
digitalWrite (LED1, on ? HIGH : LOW);
}
break;
}
}