I'm a beginner with Arduino and have a question about a sketch I copied: when I click "verify" this error message appears and I have attached a screen shot of it to this message.
How can I correct this?
Thank you
Arduino_Speed_Sensor.ino (767 Bytes)
Sorry about that, still learning how to use this forum
Never do a print in an ISR, these should be kept as short as possible.
solution, move the ISR code to the main loop and execute it if a flag is set in the ISR. Declare that flag volatile
volatile int flag = false;
...
void ISR() { flag = true; }
void loop()
{
if (flag == true)
{
flag = false; // reset
// other code
}
// rest of loop
}
Ps991
June 14, 2015, 5:57pm
4
First, you did not attach a screenshot, that is your sketch
Second, with the inadequate information provided (I cannot compile the program w/o the TimerOne library), I immediately see 2 errors.
First
Serial.print1n("Rotation per seconds");
and
serial.begin(9600);