I am new to Arduino and I have written the following function called shortC that doesn't perform quite as I want.
void shortC(){
do
{
digitalWrite(ledpin, HIGH);
}while (digitalRead(11) == HIGH);
digitalWrite(ledpin, LOW);
}
When it is called I want it to read Pin 11 and if it is High then turn the LED On. Then when Pin 11 goes Low I want it to turn the LED off and continue.
It works BUT it doesn't loop and the rest off the program carries on running. How can I make it loop while Pin 11 is High?
We need to see all of the code, but before you post it, please read Nick Gammon's post on how to properly use this Forum, especially the use of code tags when posting source code.