3. Getting Started
• Check out: http://arduino.cc/en/Guide/HomePage
1. Download & install the Arduino environment (IDE)
(not needed in lab)
2. Connect the board to your computer via the USB
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
8. Topic 2: Digital Input/Output
• Digital IO is binary
valued—it’s either on
or off, 1 or 0
• Internally, all
microprocessors are
digital, why?
1
0
9. Arduino 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
13. Some Commands
• Serial.begin()
- e.g., Serial.begin(9600)
• Serial.print() or Serial.println()
- e.g., Serial.print(value)
• Serial.read()
• Serial.available()
• Serial.write()
• Serial.parseInt()
• Example Program
14. Serial-to-USB chip---what does it do?
Image from Theory and Practice of Tangible User Interfaces at UC Berkley
The LilyPad and Fio Arduino require an external USB to
TTY connector, such as an FTDI “cable”.
In the Arduino Leonardo a single microcontroller runs the
Arduino programs and handles the USB connection.
15. Assignment 2: Serial
Communication
Modify your program from in-class
exercise 2-part 2 to control the
intensity of the LED attached to pin 9
based on keyboard input.
Use the Serial.parseInt() method to
read numeric keyboard input as an
integer.
An input of 9 should produce full
intensity and an input of 0 should turn
the LED off.
16. Arduino Quiz
Question 1:What license is Arduino distributed under?
(a) Proprietary with GNU GPL Ambient user interface
(b) Proprietary
(c)Shareware
(d) LGPL or GPL license
(a) Cross-platform
(b) Mac OS X
(c)Linux
(d) Embedded System
Question 2: Which of the following platforms does Arduino run on?
17. Question 5: The Arduino IDE is a ________ application written inJava which is
derived from the IDE made for the Processingprogramming language and
the Wiring project.
(a)(Computer
(b)Linux
(c)Cross-platform
(d)OpenOffice.org
Question 4: A typical first program for a microcontroller is to
simply blink a ________ on and off.
(a)Fluorescent lamp
(b)Gas-discharge lamp
(c)LED lamp
(d)Light-emitting diode
Question 3: They have different connectors for power and I/O, such as a series of pins on
the underside of the board for use with ________ for easy prototyping, or more specific
connectors.
(a)Breadboard
(b)Integrated circuit
(c)Capacitor
(d)Prototype