In this section we will study the general structure of an Arduino sketch. After going through this section you will be able to understand the important parts of an Arduino sketch. This section will also explain how each part of an Arduino sketch gets executed in the Arduino development board.
Arduino C programs are called sketches. A basic sketch structure needs at least two functions in the program body. These functions are listed as follows:
- setup()
- loop()
These functions should always have a same name that is, setup() and loop(). The Arduino development board is pre-programed to execute a loaded sketch by looking for these two function names in the body of a sketch. So if these two function names are not present in the C sketch, then the Arduino IDE will not even compile the sketch successfully. Instead the following errors will be...