Delete comment from: Ken Shirriff's blog
Hi,
The IR Decoding is working now.
My question is for the Apple Remote NEC protocol. Keeping the button pressed down gives you all F's.
How do you make a sketch so that is will continue to read the F's and send pin high until released?
In my instance, I want to keep the remote volume + pressed and it will continue to increase the motor volume until I release.
This is basic one so far that will connect to the L298 motor driver.
Thanks
#include
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
int led7 = 7;
int led8 = 8;
void setup()
{
pinMode(led7, OUTPUT);
pinMode(led8, OUTPUT);
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
digitalWrite(led7, LOW);
digitalWrite(led8, LOW);
}
void loop() {
if (irrecv.decode(&results)) {
switch (results.value) {
case 2011287691: //UP
digitalWrite(led7, LOW);
delay(500);
digitalWrite(led7, HIGH);
break;
case 2011279499:
digitalWrite(led8, LOW);
delay(500);
digitalWrite(led8, HIGH);
break;
}
digitalWrite(led7, HIGH);
digitalWrite(led8, HIGH);
irrecv.resume(); // Receive the next value
}
}
Sep 16, 2012, 7:04:16 PM
Posted to A Multi-Protocol Infrared Remote Library for the Arduino

