In case you never programmed before, there are some terms and concepts that are unfamiliar to you. Therefore it is wise to know your programming environment before you write your first line of code. Arduino programs are usually referred to as sketches; the first users were artists and designers, and sketch highlights the quick and easy way to realize it. The terms sketch and program are interchangeable. Sketches contain code—the instructions the board will carry out. Code that needs to run only once (such as to set up the board for your application) must be placed in the setup function. Code to be run continuously, after the initial setup has finished, goes into the loop function. To communicate between the Arduino Board and various external components such as sensors, modules,, or your computer, we need to tell the board what it is supposed to do. This tutorial introduces the core elements of Arduino programming that are essential to know before making a sketch. We will use a built-in example to clarify these elements.
The syntaxes that are used by Arduino are the punctuation and grammar of computing language. When you are starting with programming, you will get a lot of errors. However, do not worry. It will become your second nature over time.
This part of the lesson outlines the elements of an Arduino sketch.