Arduino Programming Language: If

Name

if

Description

Tests whether a certain expression has been verified, such as an input being above a certain number. 
If the expression evaluates to true, the statements enclosed within the block are executed and if the expression evaluates to false the statements are not executed.

Syntax

if (expression) {
statements
}

Parameters

  • expression: any valid expression that evaluates to true or false
  • statements: one or more statements to be executed

Usage

Application

Examples

if(variable > 100){
//do something
}


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