Hardware Reference
In-Depth Information
Basic C programming on Arduino
In this section, you'll learn about the C programming language, the language supported by
the Arduino IDE. In this section, we are going to cover some basic concepts. If you are new
to programming, there are a number of different websites that provide tutorials. If you'd
like to practice some of the basic programming concepts in C, try
www.cprogramming.com/tutorial.html or http://www.learn-c.org/ .
In this section, we'll cover how to create a basic sketch. We'll also cover how to enter some
C code, compile the code, and upload the code to your Arduino.
To open a new sketch from the IDE that contains the minimum basic code, navigate to File
| Examples | 01.Basics | BareMinimum . You should now see this in your sketch as shown
in the following screenshot:
This basic sketch provides two functions; a function is simply an organized set of instruc-
tions that Arduino will execute. When Arduino is powered on, it begins to execute a list of
instructions one by one. These start in the bootloader that configures everything and gets
Arduino to a state that you can use it. Once Arduino has completed executing the bootload-
er, it looks for the setup() function. In this function, you will specify any additional
setup activity that you need Arduino to do. Arduino will then move to the loop() func-
Search WWH ::




Custom Search