The basic structure of programs Arduino is pretty basic and consists of at least two parts. These two parties, or functions are enclosed in blocks of statements.
Void setup () {
Instructions }
Instructions}
Setup (), is the preparatory and loop () is the program itself. are needed for both functions responsibilities for executing the program.
After call setup function performs a running loop allowing to load, respond and control the Arduino plate.
A typical example is that of an LED parpadenado in official page of arduino can find several, but before you start the program in detail you can see its structure: HERE
As you can see there are no bookstores as standard C (stdio . h, Coni . h. ..) since it sorftawe the internal leads.
also recommended, as any program in C, write comments and we will be more easily modify the program if necessary.
Another recommendation is to, as shown in the example program, named after the pin , ie if pin 13 is led drive a green, instead of writing
digitalWrite (13, HIGH ), we can more easily write digitalWrite (green indicator , HIGH ), where green indicator is assigned as a 13 in the beginning of the program.
0 comments:
Post a Comment