In the following code:
void SlowDown()
{
while (digitalRead(7) == LOW)
{
LeftWing.Decrement(1);
//Serial.println("Slow Down");
}
return;
}
called from ISR routine:
void KeyRead()
{
//Serial.println("ISR Entered");
if (digitalRead(8) == LOW)
{
FastDown();
}
else if (digitalRead(7) == LOW)
{
SlowDown();
}
else if (digitalRead(6) == LOW)
{
SlowUp();
}
else if (digitalRead(5) == LOW)
{
FastUp();
}
}
I lock up and never return from the ISR.
It makes no difference if the While is in the proceedure KeyRead or any function called by KeyRead. I have tried many permutations all with the same result. The ISR works fine without the while loop.