if i want to use timer interrupt on arduino uno, is there any pin i shouldn't use? the pin that belongs to the timer on the ATmega.. is that correct or i just can use all pin and the timer as well?
fyi, my program uses digital pin 0-11 and i want to use timer 2 interrupt.. i've downloaded the MsTimer2 lib from arduino playground, and i still can't use it.. any suggestion??
my code
void loop()
{
MsTimer2::set(500, timing);
MsTimer2::start();
if (Serial.available()>0)
{
// digitalWrite(LED, HIGH);
serial=Serial.read();
if (serial=='w'){
maju();
} else if (serial=='d'){
kanan();
} else if (serial=='a'){
kiri();
} else if (serial=='s'){
mundur();
} else {
selesai();
}
}
}
void timing(){
ultrasonic();
//motor();
IR();
printing();
compass();
}
i had a very long code, i think this is the only part where i use the timer.. any help would be appreciated ^^ thankss..