In the constructor of the AppleRemoteSender class, it's talking to pins. In your code, you're initialising the class in global memory.
I recently learned that this might be a bad idea, and although I doubt it will solve your problem, it is an unnecessary risk.
I suggest to move the initialisation to the setup() method:
//Arduino Apple Remote
#include <AppleRemote2.h> //Stuff for the remote controller
int irLed = 13; // IR LED connected to digital pin 13
int lastSent;
byte remoteID = 0x05; //Stuff for the remote controller
AppleRemoteSender ars; // Declare ars (EDITED)
//Control Buttons
int play = 10;
int next = 8;
int previous = 12;
int volUp = 9;
int volDown = 11;
// The setup() method runs once, when the sketch starts
void setup() {
ars = AppleRemoteSender(irLed, remoteID); // Init ars (EDITED)
// initialize the digital pin as an output:
pinMode(play, INPUT);
pinMode(next, INPUT);
pinMode(previous, INPUT);
pinMode(volUp, INPUT);
pinMode(volDown, INPUT);
digitalWrite(next, HIGH);
digitalWrite(previous, HIGH);
digitalWrite(volUp, HIGH);
digitalWrite(volDown, HIGH);
digitalWrite(play, HIGH);
}
But why, in your loop() method, do you send each command three times?
if(digitalRead(play) == LOW){
if(lastSent == play){
ars.repeat();
ars.repeat();
ars.repeat();
}
else{
ars.play(); //Transmit the codes for Play/Pause
ars.play();
ars.play();
lastSent = play;
}
}
Is that needed for something?