Arduino Programming

The programming software we are using is called the Arduino Integrated Development Environment - Arduino Software (IDE) - which contains a variety of useful tools for controlling arduinos. The primary feature of Arduino Software (IDE) is the text editor used for writing code. The programs written with Arduino Software (IDE) are called sketches, and are saved with the file type .ino (short for Arduino). The language itself very much resembles C, but is very easy to learn due to the vast library of syntax in Arduino's Programming Reference: 


The structure of the code itself is also quite easy to figure out, as Arduino Software (IDE) comes with example code saved into the workshop itself. In its most basic form, however, the structure is really just setup and a main function. Setup is usually written before any other functions, but the order of code doesn't really matter. It is denoted:

void setup( ) {
    /*Any code can be written here, this line is commented out with slash marks

*/
}

The main function is usually a loop written as:


void loop( ) {
    /*Also, Arduino Software (IDE) will automatically indent lines in functions

*/
}

Other functions can be written by following the format "void name() { }" where name can be replaced by any function name which can be called later simply using "name();". The closed parentheses after the name of the function allow for any input required for that function. From there, the examples and references can be used to create a huge variety of programs for arduinos, controlling everything from clocks to robots to recorders.