O'Reilly logo

Arduino iOS Blueprints by Fabrizio Boco

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Arduino code

The full code of this project can be downloaded from here:

https://www.packtpub.com/books/content/support

For a better understanding of the explanations in the next paragraphs, you should open the downloaded code while reading.

Each Arduino program almost always has the following structure.

#include <library_1.h>
#include <library_2.h>

#define SOMETHING A_VALUE


// Function prototypes

void callback_1();


// Global variables

boolean  var_1;


// Called only once at power on or reset

void setup() {

...
}

// Called over and over again

void loop() {
...
}

// Callbacks 

void callback_1() {
...
}

// Additional functions

void function_1() {
...
}

The instruction #include <library_1.h> tells the compiler to use a library and the instruction #define ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required