Hide minor edits - Show changes to markup
[@
(:source lang=arduino:)
@]
While loops will loop continuously, and infinitely, until the expression inside the parenthesis, () becomes false. Something must change the tested variable, or the while loop will never exit. This could be in your code, such as an incremented variable, or an external condition, such as testing a sensor.
while loops will loop continuously, and infinitely, until the expression inside the parenthesis, () becomes false. Something must change the tested variable, or the while loop will never exit. This could be in your code, such as an incremented variable, or an external condition, such as testing a sensor.
While loops will loop continuously, and infinitely, until the expression inside the parenthesis, () becomes false. Something must change the tested variable, or the while loop will never exit. This could be in your code such as an incremented variable, or an external condition such as testing a sensor.
While loops will loop continuously, and infinitely, until the expression inside the parenthesis, () becomes false. Something must change the tested variable, or the while loop will never exit. This could be in your code, such as an incremented variable, or an external condition, such as testing a sensor.
While loops will loop continuously, and infinitely, until the expression inside the parenthesis, () becomes false. Something inside the loop must change the tested variable, or the while loop will never exit.
While loops will loop continuously, and infinitely, until the expression inside the parenthesis, () becomes false. Something must change the tested variable, or the while loop will never exit. This could be in your code such as an incremented variable, or an external condition such as testing a sensor.
// statement(s);
// statement(s)
// #statement(s)
// statement(s);
// #statement(s)
Loops continuously until the expression inside () are not true. Useful for creating your own loops, but make sure to keep track of some variable you can use to stop the while loop if that is your intent.
While loops will loop continuously, and infinitely, until the expression inside the parenthesis, () becomes false. Something inside the loop must change the tested variable, or the while loop will never exit.
while(expression){
#statement(s)
}
expression - a (boolean) C statement that evaluates to true or false
//do something repetitive 200 times
// do something repetitive 200 times
Loops continuously until the expression inside () are not true. Useful for creating your own loops, but make sure to keep track of some variable you can use to stop the while loop if that is your intent.
var = 0;
while(var < 200){
//do something repetitive 200 times
var++;
}