I want to keep my code simple. I added a little to Sheriffs to get where I am so far. I have a remote turning on an led. How do I get the led to turn back off? And then make a program that will turn on and off whenever I place the command.
Code:
/*
IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv
An IR detector/demodulator must be connected to the input RECV_PIN.
Thanks for the reply but that is not my intention. I want the led to stay lit "forever" until i feed another specific ir pulse to it to tell it to shut off.
350boatracing:
Thanks for the reply but that is not my intention. I want the led to stay lit "forever" until i feed another specific ir pulse to it to tell it to shut off.
so like this:
#include <IRremote.h>
int RECV_PIN = 11;
int ledPin=12;
IRrecv irrecv(RECV_PIN);
decode_results results;
//
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
pinMode(ledPin, OUTPUT);
}
//
void loop()
{
if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);
if (results.value==0xABE4207)
{
Serial.println("button 1");
digitalWrite(ledPin, HIGH);
}
else if(results.value==SOME_OTHER_VALUE)//<<<<<<<<<<<<<<<
{
Serial.println("Some other thing...");
digitalWrite(ledPin, LOW);
}
}
}