Understanding the Arduino Code
Structure An Arduino sketch runs in two parts: void setup() This is where you place the initialization code that is the instructions that sets up the board before the main loop of the sketch starts. void loop() This contains the main code of your sketch. It contains a set of instructions that get repeated over and over until the board is switched off. Special symbols Arduino includes a number of symbols to delineate lines of code, comments, and blocks of code. ; (semicolon) Every instruction (line of code) is terminated by a semicolon. This syntax lets you format the code freely. You could even put two instructions on the same line, as long as you separate them with a semicolon. comments(// or /*........*/) These are portions of text ignored by the Arduino processor, but are extremely useful to remind yourself (or others) of what a piece of code does. A comment can consist of one line or multi Constants Arduino includes a set of predefined k