Você está na página 1de 2

SIGN IN

E BUY SOFTWARE PRODUCTS LEARNING COMMUNITY SUPPORT

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.

Doubts on how to use Github?


Syntax
Learn everything you need to
know in this tutorial. while(condition){
// statement(s)
Last Update: 11/15/2017 }

The condition is a boolean expression that evaluates


EDIT THIS PAGE
to true or false .

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

ENTER YOUR EMAIL TO SIGN UP SUBSCRIBE

Copyright Notice
Contact Us
About Us
Careers

2017 Arduino

Você também pode gostar