if arduino code example
Example 1: arduino if-else
if (condition1) {
}
else if (condition2) {
}
else {
}
Example 2: if arduino
if (x > 120) {
digitalWrite(LEDpin, HIGH);
}
if (x > 120) {
digitalWrite(LEDpin, HIGH);
}
if (x > 120) {
digitalWrite(LEDpin, HIGH);
}
if (x > 120) {
digitalWrite(LEDpin1, HIGH);
digitalWrite(LEDpin2, HIGH);
}
Example 3: arduino what is #if
The #if condition is evaluated only at compile time. The "if" is evaluated at run time.
Example 4: if arduino
if (condition) {
}
Example 5: arduino if else
if (condition1) {
}
else if (condition2) {
}
else {
}
Example 6: if arduino
pinMode(LED_BUILTIN, OUTPUT);