ECE 209 Arduino
Presentations, etc (not by me)
- Arduino by LB8X Tom
- Introduction to Arduino by Chris Meyer
- Arduino cheat sheet by The Mechatronic Guy
In the news...
- New York Times
- Limor Fried in Wired
- IEEE Spectrum
Tutorials and books
- Getting Started with Arduino
- Language Reference
- Arduino Starter Kit Manual from Earthshine Electronic
- ITP Physical Computing tutorial
- tronixstuff
- Arduino Cookbook
- List of “all” tutorials
- planet arduino
- A very good place to start
Family
- Language from Wiring
- Environment from Processing
- Arduino
Arduino vs ...
Hosted vs Freestanding environments
The implementation of C provided by Cygwin runs in a
hosted environment. It supports the standard library
of ISO/ANSI C.
The implementations of C on embedded systems run in
freestanding environments. They use libraries
appropriate for the application. Arduino projects may use
the following libraries. Many of these are implemented with
C++ classes. For now, think of these as functions with odd
names, such as Serial.begin
rather than SerialBegin
.
- Serial library
- Arduino libraries
- contributed libraries
- AVR libc
vs PBASIC and Java ME
- Arduino is compiled into
native ATMega328 instructions
- PBASIC is compiled into tokens that are interpretted by
the BASIC Stamp
- BD-J, Blu-ray Disc Java, is compiled into
JVM, Java Virtual Machine, instructions
that are interpretted by Java ME on your blu-ray player
vs C++
In the source distribution of Arudio, there are 18 files of C and
28 files of C++.
Although many significant Arduino objects, such as Serial
from the class HardwareSerial
, are written in C;
it would be a good idea to avoid dynamically
allocated objects on the Arduino.
The main program
- no
main
function
setup
is called when the sketch starts
loop
is called continuously after setup
{
setup() ;
while (1) {
loop() ;
}
}
Useful Arduino functions
Pin I/O
Serial I/O
Timing
CamelCase
The names follow the
Java naming convention.
Shields
Gotchas
int
values range from -32768 to 32767.
209 * 2011
is 27083
209L * 2011
is 420299L
- Your sketchbook directory can be hard to find
- Look in your documents directory on Windows
- Look in your home directory on Linux
- In recent Arduino distributions, libraries must be in stored
in the libraries subdirectory of
your sketchbook directory.
- Under Windows
- It can be hard to determine the serial port of your board
- You'll need to install device drivers
- Under Linux
- The installation can be difficult on some platforms
- Arduino developers need to be in special groups
- Sometimes the download just fails
- The font size is too small
- Try not to
delay
Examples and information