Arduino for Beginners · Sketch Programming Fundamentals
Syntax, comments and common compilation errors
Sketch Programming Fundamentals
Introduction
Arduino is programmed in C++, and the compiler (avr-gcc) is ruthlessly precise: a missing semicolon, a misplaced curly brace or a typo in a name will stop the build. This lesson organizes the syntax rules (semicolon, braces { }, parentheses ( ), letter case, whitespace), shows how the // and /* */ comments work, teaches how to read the most common error messages ("expected ';'", "was not declared in this scope", "expected '}' at end of input") and how to tell a compilation error apart from a linker error and a runtime error.