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. (However, this would make the code harder to read.)
Example:
delay(100);
{} (curly braces)
This is used to mark blocks of code. For example, when you write code for the loop() function, you have to use curly braces before and after the code.
Example:
void loop() {
Serial.println("ciao");
}comments
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.
There are two styles of comments in Arduino:
// single-line: this text is ignored until the end of the line /* multiple-line: you can write a whole poem in here */
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access