Intro to the Arduino
Topics:
The Arduino
Digital IO
Analog IO
Serial Communication
Topic 1: Meet Arduino Uno
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
Arduino IDE
See: http://arduino.cc/en/Guide/Environment for more information
Select Serial Port and Board
todbot.com/blog/bionicarduino
Input/Output
Image from Theory and Practice of Tangible User Interfaces at UC Berkley
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
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
Our First Program
Assignment 1: Digital IO
• Use a push-button to turn ON/Off LED
Note
• Assignments and quiz are to be submitted
by 5th August 2016 on line
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
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.
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.
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?
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

Aurdidino1 anurag preetirajesh-sgsits

  • 1.
    Intro to theArduino Topics: The Arduino Digital IO Analog IO Serial Communication
  • 2.
    Topic 1: MeetArduino Uno
  • 3.
    Getting Started • Checkout: 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
  • 4.
  • 5.
  • 6.
  • 7.
    Input/Output Image from Theoryand Practice of Tangible User Interfaces at UC Berkley
  • 8.
    Topic 2: DigitalInput/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
  • 10.
  • 11.
    Assignment 1: DigitalIO • Use a push-button to turn ON/Off LED
  • 12.
    Note • Assignments andquiz are to be submitted by 5th August 2016 on line
  • 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 doesit 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 Modifyyour 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:Whatlicense 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: TheArduino 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