1 / 13

Microprocessors Tutorial 1: Arduino Basics

Microprocessors Tutorial 1: Arduino Basics. Agenda. 1. Arduino Hardware 2. Arduino Software 3. MAKE: Blink 4. Electronics 5. MAKE: LED control 6. Analog 7. MAKE: Volume control 8. Links. 14 Digital Pins (6 PWM). USB. Power. Arduino Hardware. Reset button. ATMega 328. 6 Analog Pins.

cree
Download Presentation

Microprocessors Tutorial 1: Arduino Basics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Microprocessors Tutorial 1: Arduino Basics

  2. Agenda 1. Arduino Hardware 2. Arduino Software 3. MAKE: Blink 4. Electronics 5. MAKE: LED control 6. Analog 7. MAKE: Volume control 8. Links

  3. 14 Digital Pins (6 PWM) USB Power Arduino Hardware Reset button ATMega 328 6 Analog Pins

  4. Code: setup(), set pin direction pinMode(pin, IN/OUTPUT) loop(), set pin value with digitalWrite(led, HIGH/LOW) Or get pin value with digitalRead(pin) Buttons: verify and upload code Arduino Software • Menu bar: set device, port, find examples

  5. MAKE: Blink • Using built in LED, so no further electronics needed! • Connect Arduino • Windows driver found? • Correct port? • Upload code

  6. Electronics • Breadboard: vertical connections, horizontal buses LEDs: polarized, long == + Resistor: Color-coded. Need one for LED Push Button: completes circuit only while pushed. Use a pull down resistor!

  7. MAKE: LED control • Hardware • Connect buses to bread board, 5v and GND • Connect LED, • pin->220ohm -> LED+ ->GND • Connect button, • 5v ->button ->10kohm ->GND • before res ->pin

  8. MAKE: LED control • Software • Declare 2 pins outside and set direction in setup() • Read button state • Software • Declare 2 pins outside and set direction in setup() • Read button state • If button is on, write desired output to LEDs

  9. +5v to pin Analog • Digital: 0-1, On/Off • LEDs, switches • digitalRead(), digitalWrite() • Analog: 0-1023 • Potentiometer, sensor, motors • AnalogRead(), analogWrite() Potentiometer: variable resistance

  10. MAKE: Volume Indicator • Hardware • Add more LEDs, each going to a different pin • Connect potentiometer, center connection to pin

  11. MAKE: Volume Indicator • Software • Add LED pin variables and set direction • Add pot pin, analog pin don't need direciton • Get pot value • Scale it using • map(number, origStart, origEnd, scaledStart, scaledEnd) • If pot level is higher than LED indicator, write desired output to LED

  12. Useful Links • Arduino Examples • http://arduino.cc/en/Tutorial/HomePage • MAKE projects • http://makezine.com/arduino/ • http://makezine.com/category/electronics/arduino/?post_type=projects • Adafruit ?

  13. ieee.concordia.ca Questions? Comments? Suggestions? academics@ieee.concordia.ca

More Related