Discover the Arduino platform, that allows to very easily develop awesome embedded stuffs, from a small bot to an advanced nanosatellite (true story!).
1. Arduino 101 – Easy embedded
development
p e n t a l o g .
f r
2. Agenda
What is that « Arduino » we're talking about ?
An Arduino board : Uno
Is there any tool ?
The Arduino language
Example 1 : Blink
Example 2 : Let's talks
Example 3 : Handling MIDI messages
Conclusion
J U LN 2 0 1 3
IY
2
p e p e a lt o g o f r. f r
nt n al . g
2
3. What is that « Arduino » ?
Open-source electronics platform
Educationnal, DIY oriented → very well documented
Robust, easy to use and low cost
Using the Arduino language
Based on ATmega microcontrollers
Different kinds of boards
J U LN 2 0 1 3
IY
2
p e p e a lt o g o f r. f r
nt n al . g
3
4. An Arduino board : Uno
ATmega 328 microcontroller @ 16 MHz
14 digital I/O
6 analog I/O
Flash memory : 32 KB
SRAM : 2 KB
EEPROM : 1 KB
J U LN 2 0 1 3
IY
2
p e p e a lt o g o f r. f r
nt n al . g
4
5. Is there any tool ?
Yes ! the Arduino IDE
Allows to write programs, debug and send
the sketch to the board
Free :)
Runs on Windows, MacOS, Linux
More extensive IDE :
Code::Blocks for Arduino
Plugins for Visual Studio, Eclipse, Xcode...
J U LN 2 0 1 3
IY
2
p e p e a lt o g o f r. f r
nt n al . g
5
6. The Arduino language
Based on Wiring, but in the end, that's C and C++
Extensive documentation
Large community : the Playground !
Development tools
Libraries
Tutorials
Default structure of a sketch :
Setup phase
The (endless) loop
J U LN 2 0 1 3
IY
2
p e p e a lt o g o f r. f r
nt n al . g
6
7. Example 1 : Blink
int led = 13;
void setup() {
pinMode(led, OUTPUT);
}
void loop() {
digitalWrite(led, HIGH);
delay(1000);
digitalWrite(led, LOW);
delay(1000);
}
J U LN 2 0 1 3
IY
2
p e p e a lt o g o f r. f r
nt n al . g
7
8. Example 2 : Let's talk
Example : send numbers from the computer and make the sum
Acrobat
Document
J U LN 2 0 1 3
IY
2
p e p e a lt o g o f r. f r
nt n al . g
8
9. Example 2 : Let's talk
Example : send numbers from the computer and make the sum
Weird results ! We actually send bytes :)
Conversions are needed :
We receive our number byte by byte : need to recreate our int
But before, we have to translate our bytes
The board can't know the length of the int : send a new line byte
Acrobat
Document
J U LN 2 0 1 3
IY
2
p e p e a lt o g o f r. f r
nt n al . g
9
10. Example 3 : Handling MIDI messages (1)
The idea : depending on the MIDI Program Change messages you
receive, switch on or off LEDs according to a defined pattern
MIDI : Musical Instrument Digital Interface
Communication protocole for digital musical instruments
Can send Notes, Program Changes (change a preset on a device),
Continuous Controls (like an expression pedal), Clock
synchronisation, …
J U LN 2 0 1 3
IY
2
p e p e a lt o g o f r. f r
nt n al . g
10
11. Example 3 : Handling MIDI messages (2)
MIDI input according to the MIDI Manufacturers Association
Add MIDI library with #include <MIDI.h>
Set up the MIDI channel & the pins
In the loop : handle the MIDI messages (PCs) and do the switching
Acrobat
Document
J U LN 2 0 1 3
IY
2
p e p e a lt o g o f r. f r
nt n al . g
11
12. Conclusion
The Arduino platform is inexpensive and easy to use
It's a growing platform
It's also fitted for production
It's open source, everyone can contribute on every level
Made in UE :)
J U LN 2 0 1 3
IY
2
p e p e a lt o g o f r. f r
nt n al . g
12