The document provides an introduction to Arduino, including:
- What an Arduino is and its main components like a microprocessor, digital pins for inputs and outputs, and analog pins.
- How to program an Arduino using a processing "sketch" with setup, loop, and other functions like digitalWrite, analogWrite, and delay.
- Examples of inputs like sensors and outputs like LEDs.
- An overview of the Arduino programming language and block-based programming with ArduBlocks.
- Information on upcoming demonstrations of Arduino projects and links for further learning resources.
2. What is the Arduino?
• A microcontroller
• Hardware + software
• You can program it, make projects with it
Inputs/Sensors
• Light
• Motion
• GPS
Arduino
Outputs: Make things happen
• Light up LEDs
Your program • Move wheels
(sketch) • Tweet
2
3. The Arduino’s Parts
Digital Pins (0 – 13) inputs & outputs
USB
- sketch
- power
Micro-
processor
External
Power Analog
(battery) Inputs
Power (0-5)
3
Sockets
5. Programming
3 main
sketch
areas
A Processing “Sketch”
Variables
Setup
– runs once
Loop
– main
program that
repeats
5
6. Basic Processing Structure
// this is a comment - make notes to yourself and to others
int led = 13; // we will connect an LED to pin # 13 – and 13 is an integer
// end lines with semicolons
void setup () // place things here that need to be set up at the beginning
{ // curly braces { } define blocks of code
pinMode(led, OUTPUT); // digital pin 13 will be an output – OUTPUT is a key word
}
void loop() // main sketch code goes here. It will repeat until the board is turned off.
{
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level) – HIGH = key word
delay(1000); // wait for one second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW – LOW = key word
delay(1000); // wait for one second
}
6
7. Processing Language Basic
Interactive Functions
pinMode(pin, mode): set a digital pin to input or output mode (INPUT or OUTPUT).
digitalRead(pin): returns the value of a digital pin, either LOW or HIGH
digitalWrite(pin, value): writes LOW or HIGH to a digital pin.
analogRead(pin): returns the value of an analog input (from 0 to 1023).
analogWrite(pin, value): writes an analog value (PWM wave) to a digital pin that
supports it (pins 3, 5, 6, 9, 10, and 11); value should be from 0 (always off) to 255
(always on).
delay(time in milliseconds): pauses the code for the amount of time in milliseconds
(1 second = 1000 milliseconds)
More terms, syntax, functions: http://arduino.cc/en/Reference/HomePage
7
11. Project Demonstrations
• We will demonstrate several projects
– Interactive game (Simon Says)
– ArduBlocks
– Light sensor input
– Arduino + Scratch
– Drawbot – a drawing robot
11
12. Videos of Other Projects for Inspiration
• LED cube:
– http://www.youtube.com/watch?v=GUcX41pokZY
• Turn signal cycling jacket:
– http://www.youtube.com/watch?v=ZtNEPkwCfxA
• Robot controlled by iPhone:
– http://www.youtube.com/watch?v=ZgMHxu6gS40
• Quadcopter:
– https://www.youtube.com/watch?v=eKWboJ0RJtQ
Search for other ideas!
12
13. Links
• Start here: http://arduino.cc/
• We have compiled links for:
– Project ideas – lists and videos
– How to program
– The videos of the demos projects
– Places to learn
• HacDC http://www.meetup.com/hac-dc/
• Nova Labs http://www.meetup.com/NOVA-Makers/
– Places to buy Arduinos and components
• All of these links will be posted at the Kids Tech Meetup
site (http://www.meetup.com/Kids-and-Technology/) and this public
EverNote notebook: https://www.evernote.com/pub/greenmoonart/arduino
13
14. Raffle
• We have a few prizes to give away
– Arduinos
– Breadboards
– Patches
14
15. Questions?
• Feel free to contact us
– John Dukovich – twitter: @JohnDukovich
– Hugo Estrada – Google+
– Phil Shapiro – twitter: @PhilShapiro
• Stay in touch with the MeetUp:
– http://www.meetup.com/Kids-and-Technology/
15