Arduino Basics

WARNING: Preprocessor macros, although tempting, can produce quite unexpected results if not done right. Always keep in mind that macros are textual substitutions done to your source code before anything is compiled. The compiler does not know anything about the macros and never gets to...
An if statement can be followed by an optional else statement, which executes when the expression is false. Syntax The syntax of an if...else statement is [codesyntax lang="cpp"] if(expression) { /* statement(s) will execute if the expression is true */ } else { /* statement(s)...
img
while loops will loop continuously, and infinitely, until the expression inside the parenthesis, () becomes false. Something must change the tested variable, or the while loop will never exit. This could be in your code, such as an incremented variable, or an external condition, such...

In this example we use the RGB led again but are introducing a couple of new programming topis. We introduce the switch case structure and the random and randomSeed functions..

This div height required for enabling the sticky sidebar
Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views :