Escolar Documentos
Profissional Documentos
Cultura Documentos
LANGUAGE
Reference > Language > Structure > Control structure >
While
FUNCTIONS
VARIABLES while
STRUCTURE
[Control Structure]
LIBRARIES
Description
GLOSSARY
A while loop will loop continuously, and infinitely, until
The Arduino Reference text is the expression inside the parenthesis, () becomes false.
licensed under a Creative
Commons AttributionShare Alike
Something must change the tested variable, or the
3.0 License. while loop will never exit. This could be in your code,
Find anything that can be
such as an incremented variable, or an external
improved? Suggest corrections condition, such as testing a sensor.
and new documentation via
GitHub.
Example Code
var = 0;
while(var < 200){
// do something repetitive 200 times
var++;
}
See also
LANGUAGE break
LANGUAGE continue
LANGUAGE do...while
LANGUAGE else
LANGUAGE for
LANGUAGE goto
E BUY SOFTWARE
LANGUAGE if...else
LANGUAGE return
LANGUAGE switch...case
EXAMPLE While Loop Tutorial
NEWSLETTER
Copyright Notice
Contact Us
About Us
Careers
2017 Arduino