14
1 Schuyler St. Leger @DocProfSky Jim St. Leger @Intel_Jim Desert Code Camp 17 November 2012 Arduino 101 Photo courtesy of Sparkfun

Arduino 101 by Schuyler St. Leger - Desert Code Camp - 2012 Nov 17

Embed Size (px)

DESCRIPTION

This 60 minute course covers the basics of Arduino. It spans from an overview of the board design (components, I/O, power, etc.) to the software development environment. Schuyler St. Leger (a.k.a. @DocProfSky), the instructor, then goes through several live examples of prototyping circuits using an Adruino Uno and a breadboard along with additional components. You will need to watch the full 60 minute video is on Youtube to see the programming examples. Programming and circuit examples include: 1) Blinking the on-board LED. 2) Blinking an LED via the digital header I/O. 3) Adding a button switch into the circuit to control the LED's on/off/on modes. This circuit expansion introduces a breadboard and the concept of a pull-down resistor to suppress electrical noise. 4) Using a potentiometer to control an LED's blink rate. The inner workings of a potentiometer is also explained. 5) Using a potentiometer to control an LED's brightness using Pulse Width Modulation (PWM.) The concept of PWM is also explained. 6) Controlling a servo motor. 7) Using a potentiometer to control a servo motor. This course was presented at Desert Code Camp, November 2012 at Chandler-Gilbert Community College in Chandler, AZ.

Citation preview

Page 1: Arduino 101 by Schuyler St. Leger - Desert Code Camp - 2012 Nov 17

1

Schuyler St. Leger @DocProfSky Jim St. Leger @Intel_Jim

Desert Code Camp 17 November 2012

Arduino 101

Photo courtesy of Sparkfun

Page 2: Arduino 101 by Schuyler St. Leger - Desert Code Camp - 2012 Nov 17

2 @DocProfSky

Agenda

• Overview of Arduino

• Software overview

• Live examples of programming

• Some references for further enlightenment

Page 3: Arduino 101 by Schuyler St. Leger - Desert Code Camp - 2012 Nov 17

3 @DocProfSky

What is Arduino?

• Open-source electronics prototyping platform

• Hardware based on Atmel 8-bit microcontroller ATmega8 series

– The DUE is 32-bit

• Open-source hardware

• Open-source software

Page 4: Arduino 101 by Schuyler St. Leger - Desert Code Camp - 2012 Nov 17

4

Arduino Uno: What’s What

USB Port

Clock/ Oscillator

Micro-controller

DC Power Port

Power Regulator

Reset Switch

Header for Digital I/O

Analog Input Header

LED Pin 13

USB Inter-face Chip

Power Header

Page 5: Arduino 101 by Schuyler St. Leger - Desert Code Camp - 2012 Nov 17

5 @DocProfSky

Software Programming

• Integrated Development Environment (IDE)

– All-in-one programming tool with built in compiler

– Supported host development platforms • Microsoft Windows

• Mac OS X

• Linux

• Arduino language is C/java based

Page 6: Arduino 101 by Schuyler St. Leger - Desert Code Camp - 2012 Nov 17

6 @DocProfSky

Software Programming

• Sketch / Program: Three main parts

1. Structure

2. Values (variables, constants)

3. Functions

Page 7: Arduino 101 by Schuyler St. Leger - Desert Code Camp - 2012 Nov 17

7 @DocProfSky

Software Programming

Let’s see some examples (easier to harder):

• Basic sketch to blink an LED (“HELLO WORLD”)

• Using a push-button switch to control an LED

• Using a potentiometer to control an LED’s blink rate

• Using a potentiometer to control an LED’s brightness (using PWM = Pulse Width Modulation)

• And more if we have time…

Page 8: Arduino 101 by Schuyler St. Leger - Desert Code Camp - 2012 Nov 17

8 @DocProfSky

Ready To Get Started!

Page 9: Arduino 101 by Schuyler St. Leger - Desert Code Camp - 2012 Nov 17

9 @DocProfSky

Ready To Get Started!

For the .NET audience

Page 10: Arduino 101 by Schuyler St. Leger - Desert Code Camp - 2012 Nov 17

10 @DocProfSky

• Arduino website: http://www.arduino.cc/

– Lots of reference information

• Forum http://arduino.cc/forum/

• Playground http://arduino.cc/playground/

• Getting Started

– Basic setup guide http://arduino.cc/en/Guide/HomePage

– Tutorials to and examples http://arduino.cc/en/Tutorial/HomePage

Where to Get More Information

Page 11: Arduino 101 by Schuyler St. Leger - Desert Code Camp - 2012 Nov 17

11 @DocProfSky

More Places to Get Information

• Ladyada.net: Great Arduino tutorial!

– http://www.ladyada.net/learn/arduino/

– Supported by Adafruit

– 5 easy lessons for happiness and prosperity • Lesson 0 Pre-flight check...Is your Arduino and computer ready?

• Lesson 1 The "Hello World!" of electronics, a simple blinking light

• Lesson 2 Sketches, variables, procedures and hacking code

• Lesson 3 Breadboards, resistors and LEDs, schematics, and basic RGB color-mixing

• Lesson 4 The serial library and binary data - getting chatty with Arduino and crunching numbers

• Lesson 5 Buttons & switches, digital inputs, pull-up and pull-down resistors, if/if-else statements, debouncing and your first contract product design.

Page 12: Arduino 101 by Schuyler St. Leger - Desert Code Camp - 2012 Nov 17

12 @DocProfSky

Even More Hardware Sources

• Adafruit http://www.adafruit.com

• Evil Mad Scientist http://www.evilmadscientist.com/

• Maker Shed http://www.makershed.com

• RadioShack http://www.radioshack.com

• SparkFun http://www.sparkfun.com/

• And many more…

Page 13: Arduino 101 by Schuyler St. Leger - Desert Code Camp - 2012 Nov 17

13 @DocProfSky

Thanks

Schuyler St. Leger

@DocProfSky

HeatSync Labs hosts Arduino meet-ups every Wednesday night.

140 W. Main St, downtown Mesa

Stop by and check it out!

Page 14: Arduino 101 by Schuyler St. Leger - Desert Code Camp - 2012 Nov 17

Desert Code Camp