SlideShare una empresa de Scribd logo
1 de 25
Our methods so far:
This circuit is a “one-liner”
Not many possibilities for interaction
Circuits hard-wired for specific purposes
Making changes requires you to re-wire, snip, de-solder, etc...
What is a “microcontroller” ?
•A small, inexpensive computer. Less sophisticated than your mac...
 think calculator
•Good for taking INPUT data, processing it, OUTPUTTING something.
•Route several different inputs to outputs, one input to many outputs,
 etc...
•Many electronic devices with any “smarts” whatsoever have some
 microcontroller.
•Higher level vs. Lower lever (Arduino is mid)




 Wiring                 Gainer                BX 24            PIC micro
Where does the
microcontroller fit in?

As an input...




Count button clicks
Sense pressure
Multiple switches
How long switch is held down
As an output...

Automate the lights
Animate multiple lights in a sequence
Put em together...
Interactive Devices
The “Big 4”
Concepts

-Digital Output
-Digital Input
-Analog Output
-Analog Input
WHAT IS ARDUINO?
Arduino
-A “single board” microcontroller and a software
 suite for programming it.



-Programming language is based on WIRING
 (similar to C++)
  -IDE is based on PROCESSING, so it looks
   friendly.
-An Italian production (IVREA Institute)
-USB to Serial interface. I/O pins. Accepts
 shields and components easily. Inexpensive &
 open-source
-Loaded with Atmel AVR microcontroller chips.
 Preinstalled “bootloader” makes it easy to
 program right out of the box!
-Clones exist.
Anatomy of an Uno
- 28 pin IC (brain). ATmega168, 328 or similar.
- A variety of components, LEDs, a crystal oscillator, a 5V
  regulator, etc.
- FTDI chip that converts USB to Serial for easy
  communication with your pute.
- 14 Digital I/O pins. (0-13)
- 6 Analog In pins (0-5)
- 6 pins can be used as Analog Out (3,5,6,9,10,11)
DIGITAL I/O PINS



 USB




       5V
REGULATOR     MICROCONTROLLER

EXTERNAL
   POWER

                POWER   ANALOG IN
Each DIGITAL OUT pin acts like a mini 5V power supply.
Don’t forget about Ground!



                                           + 9V




                                              470

                      instead of...
220Ω
LED
Now we need to give the board instructions on what to do...
What is Code?
A set of instructions (“an algorithm”)
that tells the board exactly what to do,
for how long and in what order. A
procedure, a program.


Knitting a scarf:
Row 1: (RS) *K2, P2* across
Rows 2, 3 & 4: Repeat Row 1
Row 5: (RS0 *K2, P2, C8F* Repeat to last 4 sts, K2, P2
Row 6: Repeat Row 1
Repeat rows 1-6 for desired length, ending with row 4
Bind off in K2, P2 pattern
Hiking directions to Point Break




From the North:
-Follow the trail from the Nature Center
-Turn right at the Water Tower, walk up to the Old Oak Tree
-Follow directions from the Old Oak Tree.

From the South:
-From the hPicnic Grove, follow    the Botany Trail
-Turn right on the South Meadow    Trail
-Turn right on the Meadow Ranch    Trail, walk until you see the Old
Oak Tree
-Follow directions from the Old    Oak Tree.

From the Old Oak Tree:
-Follow the path under the tree
-Turn right onto the Long Hill Trail
-Follow the trail until you reach Point Break
A code snippet from PROCESSING




                                          Produces This:




* Arduino is based off ofsimilar. Don’t
  IDE. So they look very
                          Processing’s

  mix the two up though.
Anatomy of an
Arduino Program


Buttons for common tasks
                Comments
               Variables
            Setup & Loop
               Functions


            Message Area
                 Console
Structure

                               Up Top:
  “Declare” and “Assign” any variables
             you’re going to be using.


                                SETUP:
 The code in this block runs only once
              when the program begins.




                                   LOOP:
   The code in this block runs after the
         setup, 100’s of times a second.
 Each line of code runs once from top to
                                 bottom.

Once the loops is entered, we stay there
         until the Arduino is unplugged.
Breakdown
    Make a few notes to myself, so when I
return to this later, I can remember more
                                easily...


  Give the #13 a nickname so I can use it
multiple times. If I change 13 to 10 now,
     I only have to change it once, here!

Make sure Arduino knows pin 13 (nicknamed
      “led”) is going to serve as OUTPUT.




Specify some instructions for how long to
      turn the LED on/off. This part will
              repeat over and over again.




If you remove the last delay(1000); what
                                happens?

       Can you make the LED blink “SOS”?
A few definitions
 Variable: Store a value (integer, decimal number, true/false value, etc.) in
 computer memory so you can use it many times throughout the life of the program.
 Variables have two steps: declare and assign. Sometimes these happen on one line,
 like you see below.




                                                                  So this:



  Declare that that        Assign it a value of
    you’re making a        13, representing the
    variable called        pin that the LED is
 “led” of type int.        connected to!
                                                                  Is identical to this:




... gets assigned to
 what’s on the left.
                       =   What’s on the right
                           hand side of the                       As far as the Arduino
                           equals sign...                         is concerned.
A few definitions
Function: Code modules that can be “called” in your program. A function is actually
a ‘nickname’ given to other lines of code, written and stored elsewhere. Arduino has
a large selection of existing functions. Each one does something specific like “send
5v to pin X” or “delay for one second”. Functions can be customized sometimes, with
“parameters”




                                                          You can write your own
                                                          functions too! These are
                                                          just the ones that come
                        digitalWrite takes                with Arduino.
      the name of the
                        two parameters,
       function begin
                        which pin? and what
  called. Note the ()
                        state?


                        It’s like saying
                        “set ‘led’ (13) to
                        HIGH”.

                        Meaning...
                        “Send 5V to pin 13”
For more, visit the Arduino website:
arduino.cc

and check out their tutorials:
http://arduino.cc/en/Tutorial/Foundations

Más contenido relacionado

La actualidad más candente

Arduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic ArduinoArduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic ArduinoVishnu
 
2015-10-21 - Arduino workshop
2015-10-21 - Arduino workshop2015-10-21 - Arduino workshop
2015-10-21 - Arduino workshoptrygvis
 
Arduino Workshop
Arduino WorkshopArduino Workshop
Arduino Workshopatuline
 
Arduino Full Tutorial
Arduino Full TutorialArduino Full Tutorial
Arduino Full TutorialAkshay Sharma
 
Arduino Lecture 2 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 2 - Interactive Media CS4062 Semester 2 2009Arduino Lecture 2 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 2 - Interactive Media CS4062 Semester 2 2009Eoin Brazil
 
Arduino Introduction Guide 1
Arduino Introduction Guide 1Arduino Introduction Guide 1
Arduino Introduction Guide 1elketeaches
 
Arduino for Beginners
Arduino for BeginnersArduino for Beginners
Arduino for BeginnersSarwan Singh
 
Arduino experimenters guide hq
Arduino experimenters guide hqArduino experimenters guide hq
Arduino experimenters guide hqAndreis Santos
 
Lesson sample introduction to arduino
Lesson sample   introduction to arduinoLesson sample   introduction to arduino
Lesson sample introduction to arduinoBetsy Eng
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduinoyeokm1
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the ArduinoWingston
 
Programming with arduino
Programming with arduinoProgramming with arduino
Programming with arduinoMakers of India
 
Arduino Day 1 Presentation
Arduino Day 1 PresentationArduino Day 1 Presentation
Arduino Day 1 PresentationYogendra Tamang
 
Arduino slides
Arduino slidesArduino slides
Arduino slidessdcharle
 
NSTA 2013 Denver - ArduBlock and Arduino
NSTA 2013 Denver - ArduBlock and ArduinoNSTA 2013 Denver - ArduBlock and Arduino
NSTA 2013 Denver - ArduBlock and ArduinoBrian Huang
 

La actualidad más candente (20)

Arduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic ArduinoArduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic Arduino
 
2015-10-21 - Arduino workshop
2015-10-21 - Arduino workshop2015-10-21 - Arduino workshop
2015-10-21 - Arduino workshop
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Arduino Workshop
Arduino WorkshopArduino Workshop
Arduino Workshop
 
Arduino Full Tutorial
Arduino Full TutorialArduino Full Tutorial
Arduino Full Tutorial
 
Arduino Lecture 2 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 2 - Interactive Media CS4062 Semester 2 2009Arduino Lecture 2 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 2 - Interactive Media CS4062 Semester 2 2009
 
Arduino Introduction Guide 1
Arduino Introduction Guide 1Arduino Introduction Guide 1
Arduino Introduction Guide 1
 
Arduino for Beginners
Arduino for BeginnersArduino for Beginners
Arduino for Beginners
 
Arduino experimenters guide hq
Arduino experimenters guide hqArduino experimenters guide hq
Arduino experimenters guide hq
 
Lesson sample introduction to arduino
Lesson sample   introduction to arduinoLesson sample   introduction to arduino
Lesson sample introduction to arduino
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
 
Lab2ppt
Lab2pptLab2ppt
Lab2ppt
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Basic Sensors
Basic Sensors Basic Sensors
Basic Sensors
 
Programming with arduino
Programming with arduinoProgramming with arduino
Programming with arduino
 
Arduino Workshop Day 2
Arduino  Workshop Day 2Arduino  Workshop Day 2
Arduino Workshop Day 2
 
Arduino Day 1 Presentation
Arduino Day 1 PresentationArduino Day 1 Presentation
Arduino Day 1 Presentation
 
Arduino slides
Arduino slidesArduino slides
Arduino slides
 
NSTA 2013 Denver - ArduBlock and Arduino
NSTA 2013 Denver - ArduBlock and ArduinoNSTA 2013 Denver - ArduBlock and Arduino
NSTA 2013 Denver - ArduBlock and Arduino
 

Similar a Hello Arduino.

Arduino and Circuits.docx
Arduino and Circuits.docxArduino and Circuits.docx
Arduino and Circuits.docxAjay578679
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduinoavikdhupar
 
Ch_2_8,9,10.pptx
Ch_2_8,9,10.pptxCh_2_8,9,10.pptx
Ch_2_8,9,10.pptxyosikit826
 
Microcontroller Programming & Hardware Introduction
Microcontroller Programming & Hardware IntroductionMicrocontroller Programming & Hardware Introduction
Microcontroller Programming & Hardware IntroductionJoseph Sanchez
 
Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينوsalih mahmod
 
Arduino workshop
Arduino workshopArduino workshop
Arduino workshopmayur1432
 
Lab 2_ Programming an Arduino.pdf
Lab 2_ Programming an Arduino.pdfLab 2_ Programming an Arduino.pdf
Lab 2_ Programming an Arduino.pdfssuser0e9cc4
 
ATTiny Light Sculpture Project - Part I (Setup)
ATTiny Light Sculpture Project - Part I (Setup)ATTiny Light Sculpture Project - Part I (Setup)
ATTiny Light Sculpture Project - Part I (Setup)Brian Huang
 
Arduino Workshop Slides
Arduino Workshop SlidesArduino Workshop Slides
Arduino Workshop Slidesmkarlin14
 
Arduino Slides With Neopixels
Arduino Slides With NeopixelsArduino Slides With Neopixels
Arduino Slides With Neopixelssdcharle
 
Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptxHebaEng
 
Lily pad dev_handout
Lily pad dev_handoutLily pad dev_handout
Lily pad dev_handoutKhuê Phạm
 
Physical prototyping lab1-input_output (2)
Physical prototyping lab1-input_output (2)Physical prototyping lab1-input_output (2)
Physical prototyping lab1-input_output (2)Tony Olsson.
 
Introduction to Arduino 16822775 (2).ppt
Introduction to Arduino 16822775 (2).pptIntroduction to Arduino 16822775 (2).ppt
Introduction to Arduino 16822775 (2).pptansariparveen06
 
Arduino comic v0004
Arduino comic v0004Arduino comic v0004
Arduino comic v0004DO!MAKERS
 
Arduino spooky projects_class1
Arduino spooky projects_class1Arduino spooky projects_class1
Arduino spooky projects_class1Felipe Belarmino
 

Similar a Hello Arduino. (20)

Arduino and Circuits.docx
Arduino and Circuits.docxArduino and Circuits.docx
Arduino and Circuits.docx
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduino
 
Ch_2_8,9,10.pptx
Ch_2_8,9,10.pptxCh_2_8,9,10.pptx
Ch_2_8,9,10.pptx
 
Introduction Arduino
Introduction Arduino Introduction Arduino
Introduction Arduino
 
Microcontroller Programming & Hardware Introduction
Microcontroller Programming & Hardware IntroductionMicrocontroller Programming & Hardware Introduction
Microcontroller Programming & Hardware Introduction
 
Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينو
 
Arduino workshop
Arduino workshopArduino workshop
Arduino workshop
 
Lab 2_ Programming an Arduino.pdf
Lab 2_ Programming an Arduino.pdfLab 2_ Programming an Arduino.pdf
Lab 2_ Programming an Arduino.pdf
 
ATTiny Light Sculpture Project - Part I (Setup)
ATTiny Light Sculpture Project - Part I (Setup)ATTiny Light Sculpture Project - Part I (Setup)
ATTiny Light Sculpture Project - Part I (Setup)
 
Arduino Workshop Slides
Arduino Workshop SlidesArduino Workshop Slides
Arduino Workshop Slides
 
Arduino intro.pptx
Arduino intro.pptxArduino intro.pptx
Arduino intro.pptx
 
Arduino Slides With Neopixels
Arduino Slides With NeopixelsArduino Slides With Neopixels
Arduino Slides With Neopixels
 
Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptx
 
Lily pad dev_handout
Lily pad dev_handoutLily pad dev_handout
Lily pad dev_handout
 
Physical prototyping lab1-input_output (2)
Physical prototyping lab1-input_output (2)Physical prototyping lab1-input_output (2)
Physical prototyping lab1-input_output (2)
 
What is arduino
What is arduinoWhat is arduino
What is arduino
 
Introduction to Arduino 16822775 (2).ppt
Introduction to Arduino 16822775 (2).pptIntroduction to Arduino 16822775 (2).ppt
Introduction to Arduino 16822775 (2).ppt
 
Arduino Comic-Jody Culkin-2011
Arduino Comic-Jody Culkin-2011Arduino Comic-Jody Culkin-2011
Arduino Comic-Jody Culkin-2011
 
Arduino comic v0004
Arduino comic v0004Arduino comic v0004
Arduino comic v0004
 
Arduino spooky projects_class1
Arduino spooky projects_class1Arduino spooky projects_class1
Arduino spooky projects_class1
 

Más de mkontopo

Electronic Components
Electronic ComponentsElectronic Components
Electronic Componentsmkontopo
 
DC Concepts
DC ConceptsDC Concepts
DC Conceptsmkontopo
 
ID01 Week 4
ID01 Week 4ID01 Week 4
ID01 Week 4mkontopo
 
ID01 Week 3
ID01 Week 3ID01 Week 3
ID01 Week 3mkontopo
 
ID01 / W01
ID01 / W01ID01 / W01
ID01 / W01mkontopo
 

Más de mkontopo (6)

Electronic Components
Electronic ComponentsElectronic Components
Electronic Components
 
DC Concepts
DC ConceptsDC Concepts
DC Concepts
 
ID01 Week 4
ID01 Week 4ID01 Week 4
ID01 Week 4
 
ID01 Week 3
ID01 Week 3ID01 Week 3
ID01 Week 3
 
ID01 W2
ID01 W2ID01 W2
ID01 W2
 
ID01 / W01
ID01 / W01ID01 / W01
ID01 / W01
 

Hello Arduino.

  • 1.
  • 2. Our methods so far: This circuit is a “one-liner” Not many possibilities for interaction Circuits hard-wired for specific purposes Making changes requires you to re-wire, snip, de-solder, etc...
  • 3. What is a “microcontroller” ? •A small, inexpensive computer. Less sophisticated than your mac... think calculator •Good for taking INPUT data, processing it, OUTPUTTING something. •Route several different inputs to outputs, one input to many outputs, etc... •Many electronic devices with any “smarts” whatsoever have some microcontroller. •Higher level vs. Lower lever (Arduino is mid) Wiring Gainer BX 24 PIC micro
  • 4. Where does the microcontroller fit in? As an input... Count button clicks Sense pressure Multiple switches How long switch is held down
  • 5. As an output... Automate the lights Animate multiple lights in a sequence
  • 7. The “Big 4” Concepts -Digital Output -Digital Input -Analog Output -Analog Input
  • 9.
  • 10. Arduino -A “single board” microcontroller and a software suite for programming it. -Programming language is based on WIRING (similar to C++) -IDE is based on PROCESSING, so it looks friendly. -An Italian production (IVREA Institute) -USB to Serial interface. I/O pins. Accepts shields and components easily. Inexpensive & open-source -Loaded with Atmel AVR microcontroller chips. Preinstalled “bootloader” makes it easy to program right out of the box! -Clones exist.
  • 11. Anatomy of an Uno - 28 pin IC (brain). ATmega168, 328 or similar. - A variety of components, LEDs, a crystal oscillator, a 5V regulator, etc. - FTDI chip that converts USB to Serial for easy communication with your pute. - 14 Digital I/O pins. (0-13) - 6 Analog In pins (0-5) - 6 pins can be used as Analog Out (3,5,6,9,10,11)
  • 12. DIGITAL I/O PINS USB 5V REGULATOR MICROCONTROLLER EXTERNAL POWER POWER ANALOG IN
  • 13.
  • 14. Each DIGITAL OUT pin acts like a mini 5V power supply. Don’t forget about Ground! + 9V 470 instead of...
  • 16. Now we need to give the board instructions on what to do...
  • 17. What is Code? A set of instructions (“an algorithm”) that tells the board exactly what to do, for how long and in what order. A procedure, a program. Knitting a scarf: Row 1: (RS) *K2, P2* across Rows 2, 3 & 4: Repeat Row 1 Row 5: (RS0 *K2, P2, C8F* Repeat to last 4 sts, K2, P2 Row 6: Repeat Row 1 Repeat rows 1-6 for desired length, ending with row 4 Bind off in K2, P2 pattern
  • 18. Hiking directions to Point Break From the North: -Follow the trail from the Nature Center -Turn right at the Water Tower, walk up to the Old Oak Tree -Follow directions from the Old Oak Tree. From the South: -From the hPicnic Grove, follow the Botany Trail -Turn right on the South Meadow Trail -Turn right on the Meadow Ranch Trail, walk until you see the Old Oak Tree -Follow directions from the Old Oak Tree. From the Old Oak Tree: -Follow the path under the tree -Turn right onto the Long Hill Trail -Follow the trail until you reach Point Break
  • 19. A code snippet from PROCESSING Produces This: * Arduino is based off ofsimilar. Don’t IDE. So they look very Processing’s mix the two up though.
  • 20. Anatomy of an Arduino Program Buttons for common tasks Comments Variables Setup & Loop Functions Message Area Console
  • 21. Structure Up Top: “Declare” and “Assign” any variables you’re going to be using. SETUP: The code in this block runs only once when the program begins. LOOP: The code in this block runs after the setup, 100’s of times a second. Each line of code runs once from top to bottom. Once the loops is entered, we stay there until the Arduino is unplugged.
  • 22. Breakdown Make a few notes to myself, so when I return to this later, I can remember more easily... Give the #13 a nickname so I can use it multiple times. If I change 13 to 10 now, I only have to change it once, here! Make sure Arduino knows pin 13 (nicknamed “led”) is going to serve as OUTPUT. Specify some instructions for how long to turn the LED on/off. This part will repeat over and over again. If you remove the last delay(1000); what happens? Can you make the LED blink “SOS”?
  • 23. A few definitions Variable: Store a value (integer, decimal number, true/false value, etc.) in computer memory so you can use it many times throughout the life of the program. Variables have two steps: declare and assign. Sometimes these happen on one line, like you see below. So this: Declare that that Assign it a value of you’re making a 13, representing the variable called pin that the LED is “led” of type int. connected to! Is identical to this: ... gets assigned to what’s on the left. = What’s on the right hand side of the As far as the Arduino equals sign... is concerned.
  • 24. A few definitions Function: Code modules that can be “called” in your program. A function is actually a ‘nickname’ given to other lines of code, written and stored elsewhere. Arduino has a large selection of existing functions. Each one does something specific like “send 5v to pin X” or “delay for one second”. Functions can be customized sometimes, with “parameters” You can write your own functions too! These are just the ones that come digitalWrite takes with Arduino. the name of the two parameters, function begin which pin? and what called. Note the () state? It’s like saying “set ‘led’ (13) to HIGH”. Meaning... “Send 5V to pin 13”
  • 25. For more, visit the Arduino website: arduino.cc and check out their tutorials: http://arduino.cc/en/Tutorial/Foundations

Notas del editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. 1. There are many ways to write one given algorithm\n2. An algorithm requires certain assumptions\n3. An algorithm includes decision making\n4. A complex algorithm should be broken down into modular pieces.\n
  20. \n
  21. \n
  22. \n
  23. The computer needs to know what type of data you’re going to be storing, so it knows how much memory to set aside. ints take up less room than floats. \n
  24. If you forget, check the reference on the website.\n
  25. \n