Hi there, I am stumped on this:
I want to get more than one pin to do the exact same thing as pin 3 in this example, as I want to hookup more IR leds to make the remote signal stronger. If this doesent make sense, I am trying to use more than one pin to add more IR leds to this remote, thus making it have a stronger signal. I initally tried to do this by assigning more than one pin to an int value (such as int led = 3, 4, 5; ) but it didnt work as planned. Could someone please help me? Thanks so much! Here is the code:
#include <AppleRemoteSender.h>
int irLed = 3;
long randomtime;
long randomaction;
byte remoteID = 0x05;
AppleRemoteSender ars = AppleRemoteSender(irLed, remoteID);
void setup() {
randomSeed(analogRead(0)); //make it more random :o
//wait five minutes so we have time to hide the arduino.
}
void loop() //let's start annoying! :D
{
randomaction = random(6); //get a random number (0, 1, 2, 3, 4 or 5) to randomize the action
if (randomaction = 0) //if the random number is 0
{
ars.left(); //we've got to go back... to the future! (send the left button command)
ars.left();
ars.left();
}
else if (randomaction = 1) //if it's 1
{
ars.right(); //we've got to go forward... to the past! (send the right button command)
ars.right();
ars.right();
}
else if (randomaction = 2) //if it's 2
{
ars.menu(); //main scr...menu turn on!
ars.menu();
ars.menu();
}
else if (randomaction = 3) //if it's 3
{
ars.play(); //play!
ars.play();
ars.play();
}
else if (randomaction = 4) //if it's 4
{
ars.up(); //louder... louder... LOUDER...
ars.up();
ars.up();
}
else if (randomaction = 5) //if it's 5
{
ars.down(); //volume down
ars.down();
ars.down();
}
delay(500); //wait half a second
}