Professional Documents
Culture Documents
• The board incorporates 5v and 3.3v LDO regulators to provide regulated voltage
sources using either USB bus power or an external power supply of 7-12 volts
• There are also indicator LED’s for power and serial activity, as well as a single user
LED on pin 13
• The microcontroller pin-nodes are made accessible by 0.10” female headers on the
sides of the board
• Pins are grouped according to function and are labeled at the foot of the pins
Arduino Duemilanove
ATMega328p 8-Bit Microcontroller
Clock speed: 16 MHz
Memory
32 KB flash memory (including 2 KB for bootloader)
2 KB SRAM for holding variables
1 KB EEPROM for saving data
Operating Voltage: 5 V
Power Supply
5V regulated supply via USB, host PC
( Range: 7-12 V, Limits: 6-20 V )
Vin: regulated external power, or Battery (9V)
Note:
• Aside from the supporting circuitry and an installed bootloader, the
Arduino board is just an ATMEGA328 processor
• Most codes written for any ATMEGAxx8x microcontroller is likely to work
for Arduino with little modification
Arduino Information
Arduino - HomePage:
• http://arduino.cc/
void loop() {
}
// command runs a repeating loop after setup
// One-line comment
/* Multi-line comment */
Serial Commands
serial.begin(baud rate) -start serial communication with PC
serial.println(value) -print value to PC
serial.print(“…”, value) -print value without line
serial.read(“…”, value) -read value from PC with concatenation
Example Arduino Sketch
/* Blink
Turns on an LED for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
void setup() {
// initialize the digital pin as an output
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH); // set the LED on
delay(1000); // wait for a second (1000 ms)
digitalWrite(13, LOW); // set the LED off
delay(1000); // wait for a second
} More tutorials found at
http://arduino.cc/en/Tutorial/HomePage
Programming Arduino with Matlab
Arduino can be interactively programmed in Matlab
Example:
A Simulink model that solves the Arduino Blink
Challenge. The controlled circuit switches
between four modes: all LEDs off, all LEDs on,
LEDs blinking simultaneously, and LEDs cycling
at a specified frequency. This model is included
with Arduino Blink Challenge Simulink Models.