Arduino Programming Language: While

Name

while

Description

The structure executes a series of statements continuously while the expression is true. The expression must be updated during the repetitions or the program will never "break out" of while(). 
The statement can be an incremented variable, or an external condition.

Syntax

while(expression){
//statement
}

Parameters

  • expression: is a boolean statement that evaluates to true or false.

Usage

Application

Examples

var=0;
while(var<100){
//do something repetitive 100 times
var++;
}


Based on the reference originally written by Arduino Community,  wiring.org.co and  arduino.cc