2. What is a Microcontroller
• A small computer on a single chip
• containing a processor, memory, and input/output
3. What is a Development Board
• A printed circuit
board designed to
facilitate work with a
particular
microcontroller.
• Typical components include:
• power circuit
• programming interface
• basic input; usually buttons and LEDs
• I/O pins
4. Arduino Introduction
• Arduino platform offers open source hardware
and software that is easy to use and is used
widely for hobby projects and prototyping.
• Arduino provides many types of boards which
are useful for various applications.
• Arduino also provides its own IDE (Integrated
Development Environment) which is free to
download from Arduino’s website and use.
9. What is the Arduino
todbot.com/blog/bionicarduino
10. Getting Started
• Check out: http://arduino.cc/en/Guide/HomePage
1. Download & install the Arduino environment (IDE)
2. Connect the board to your computer via the UBS cable
3. If needed, install the drivers (not needed in lab)
4. Launch the Arduino IDE
5. Select your board
6. Select your serial port
7. Open the blink example
8. Upload the program
16. Add an External LED to pin 13
• File > Examples > Digital > Blink
• LED’s have polarity
– Negative indicated by flat side of the housing
and a short leg
www.instructables.com
17. A Little Bit About Programming
• Code is case
sensitive
• Statements are
commands and
must end with a
semi-colon
• Comments follow
a // or begin with /*
and end with */
• loop and setup
20. Digital I/0
pinMode(pin, mode)
Sets pin to either INPUT or OUTPUT
digitalRead(pin)
Reads HIGH or LOW from a pin
digitalWrite(pin, value)
Writes HIGH or LOW to a pin
Electronic stuff
Output pins can provide 40 mA of current
Writing HIGH to an input pin installs a 20KΩ pullup
www.mikroe.com/chapters/view/1
21. Arduino Timing
• delay(ms)
– Pauses for a few milliseconds
• delayMicroseconds(us)
– Pauses for a few microseconds
• More commands:
arduino.cc/en/Reference/HomePage
22. Digital? Analog?
• Digital has two values: on and off
• Analog has many (infinite) values
• Computers don’t really do analog, they quantize
• Remember the 6 analog input pins---here’s how
they work
todbot.com/blog/bionicarduino
25. Putting It Together
• Complete the sketch
(program) below.
• What output will be
generated by this program?
• What if the schematic were
changed?
www.ladyada.net/learn/arduino