際際滷

際際滷Share a Scribd company logo
Hello Arduino.
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?
Hello 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
Hello Arduino.
Each DIGITAL OUT pin acts like a mini 5V power supply.
Dont 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. Dont
  IDE. So they look very
                          Processings

  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
             youre 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, 100s 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
    youre 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
 whats on the left.
                       =   Whats 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?


                        Its 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

More Related Content

What's hot (20)

Arduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic ArduinoArduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic Arduino
Vishnu
2015-10-21 - Arduino workshop
2015-10-21 - Arduino workshop2015-10-21 - Arduino workshop
2015-10-21 - Arduino workshop
trygvis
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
baabtra.com - No. 1 supplier of quality freshers
Arduino Workshop
Arduino WorkshopArduino Workshop
Arduino Workshop
atuline
Arduino Full Tutorial
Arduino Full TutorialArduino Full Tutorial
Arduino Full Tutorial
Akshay 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 2009
Eoin Brazil
Arduino Introduction Guide 1
Arduino Introduction Guide 1Arduino Introduction Guide 1
Arduino Introduction Guide 1
elketeaches
Arduino for Beginners
Arduino for BeginnersArduino for Beginners
Arduino for Beginners
Sarwan Singh
Arduino experimenters guide hq
Arduino experimenters guide hqArduino experimenters guide hq
Arduino experimenters guide hq
Andreis Santos
Lesson sample introduction to arduino
Lesson sample   introduction to arduinoLesson sample   introduction to arduino
Lesson sample introduction to arduino
Betsy Eng
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
yeokm1
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
Wingston
Lab2ppt
Lab2pptLab2ppt
Lab2ppt
Zhentao Xu
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
Luki B. Subekti
Basic Sensors
Basic Sensors Basic Sensors
Basic Sensors
creatjet3d labs
Programming with arduino
Programming with arduinoProgramming with arduino
Programming with arduino
Makers of India
Arduino Workshop Day 2
Arduino  Workshop Day 2Arduino  Workshop Day 2
Arduino Workshop Day 2
Yogendra Tamang
Arduino Day 1 Presentation
Arduino Day 1 PresentationArduino Day 1 Presentation
Arduino Day 1 Presentation
Yogendra Tamang
Arduino slides
Arduino slidesArduino slides
Arduino slides
sdcharle
NSTA 2013 Denver - ArduBlock and Arduino
NSTA 2013 Denver - ArduBlock and ArduinoNSTA 2013 Denver - ArduBlock and Arduino
NSTA 2013 Denver - ArduBlock and Arduino
Brian Huang
Arduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic ArduinoArduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic Arduino
Vishnu
2015-10-21 - Arduino workshop
2015-10-21 - Arduino workshop2015-10-21 - Arduino workshop
2015-10-21 - Arduino workshop
trygvis
Arduino Workshop
Arduino WorkshopArduino Workshop
Arduino Workshop
atuline
Arduino Full Tutorial
Arduino Full TutorialArduino Full Tutorial
Arduino Full Tutorial
Akshay 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 2009
Eoin Brazil
Arduino Introduction Guide 1
Arduino Introduction Guide 1Arduino Introduction Guide 1
Arduino Introduction Guide 1
elketeaches
Arduino for Beginners
Arduino for BeginnersArduino for Beginners
Arduino for Beginners
Sarwan Singh
Arduino experimenters guide hq
Arduino experimenters guide hqArduino experimenters guide hq
Arduino experimenters guide hq
Andreis Santos
Lesson sample introduction to arduino
Lesson sample   introduction to arduinoLesson sample   introduction to arduino
Lesson sample introduction to arduino
Betsy Eng
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
yeokm1
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
Wingston
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
Luki B. Subekti
Programming with arduino
Programming with arduinoProgramming with arduino
Programming with arduino
Makers of India
Arduino Workshop Day 2
Arduino  Workshop Day 2Arduino  Workshop Day 2
Arduino Workshop Day 2
Yogendra Tamang
Arduino Day 1 Presentation
Arduino Day 1 PresentationArduino Day 1 Presentation
Arduino Day 1 Presentation
Yogendra Tamang
Arduino slides
Arduino slidesArduino slides
Arduino slides
sdcharle
NSTA 2013 Denver - ArduBlock and Arduino
NSTA 2013 Denver - ArduBlock and ArduinoNSTA 2013 Denver - ArduBlock and Arduino
NSTA 2013 Denver - ArduBlock and Arduino
Brian Huang

Similar to Hello Arduino. (20)

Arduino and Circuits.docx
Arduino and Circuits.docxArduino and Circuits.docx
Arduino and Circuits.docx
Ajay578679
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduino
avikdhupar
Ch_2_8,9,10.pptx
Ch_2_8,9,10.pptxCh_2_8,9,10.pptx
Ch_2_8,9,10.pptx
yosikit826
Introduction Arduino
Introduction Arduino Introduction Arduino
Introduction Arduino
Venkatesh Mukkapati
Microcontroller Programming & Hardware Introduction
Microcontroller Programming & Hardware IntroductionMicrocontroller Programming & Hardware Introduction
Microcontroller Programming & Hardware Introduction
Joseph Sanchez
Arduino 悋惘惆
Arduino 悋惘惆Arduino 悋惘惆
Arduino 悋惘惆
salih mahmod
Arduino workshop
Arduino workshopArduino workshop
Arduino workshop
mayur1432
Lab 2_ Programming an Arduino.pdf
Lab 2_ Programming an Arduino.pdfLab 2_ Programming an Arduino.pdf
Lab 2_ Programming an Arduino.pdf
ssuser0e9cc4
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 際際滷s
Arduino Workshop 際際滷sArduino Workshop 際際滷s
Arduino Workshop 際際滷s
mkarlin14
Arduino intro.pptx
Arduino intro.pptxArduino intro.pptx
Arduino intro.pptx
SanthanaMari11
Arduino 際際滷s With Neopixels
Arduino 際際滷s With NeopixelsArduino 際際滷s With Neopixels
Arduino 際際滷s With Neopixels
sdcharle
Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptx
HebaEng
Lily pad dev_handout
Lily pad dev_handoutLily pad dev_handout
Lily pad dev_handout
Khu棚 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.
What is arduino
What is arduinoWhat is arduino
What is arduino
vivek kumar
Presentation of online Internship Program on Arduino completed at INTERNSHALA
Presentation of online Internship Program on Arduino completed at INTERNSHALAPresentation of online Internship Program on Arduino completed at INTERNSHALA
Presentation of online Internship Program on Arduino completed at INTERNSHALA
AviPatel16612
Introduction to Arduino 16822775 (2).ppt
Introduction to Arduino 16822775 (2).pptIntroduction to Arduino 16822775 (2).ppt
Introduction to Arduino 16822775 (2).ppt
ansariparveen06
Arduino comic v0004
Arduino comic v0004Arduino comic v0004
Arduino comic v0004
DO!MAKERS
Arduino Comic-Jody Culkin-2011
Arduino Comic-Jody Culkin-2011Arduino Comic-Jody Culkin-2011
Arduino Comic-Jody Culkin-2011
流亮凌 劉亮侶
Arduino and Circuits.docx
Arduino and Circuits.docxArduino and Circuits.docx
Arduino and Circuits.docx
Ajay578679
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduino
avikdhupar
Ch_2_8,9,10.pptx
Ch_2_8,9,10.pptxCh_2_8,9,10.pptx
Ch_2_8,9,10.pptx
yosikit826
Microcontroller Programming & Hardware Introduction
Microcontroller Programming & Hardware IntroductionMicrocontroller Programming & Hardware Introduction
Microcontroller Programming & Hardware Introduction
Joseph Sanchez
Arduino 悋惘惆
Arduino 悋惘惆Arduino 悋惘惆
Arduino 悋惘惆
salih mahmod
Arduino workshop
Arduino workshopArduino workshop
Arduino workshop
mayur1432
Lab 2_ Programming an Arduino.pdf
Lab 2_ Programming an Arduino.pdfLab 2_ Programming an Arduino.pdf
Lab 2_ Programming an Arduino.pdf
ssuser0e9cc4
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 際際滷s
Arduino Workshop 際際滷sArduino Workshop 際際滷s
Arduino Workshop 際際滷s
mkarlin14
Arduino 際際滷s With Neopixels
Arduino 際際滷s With NeopixelsArduino 際際滷s With Neopixels
Arduino 際際滷s With Neopixels
sdcharle
Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptx
HebaEng
Lily pad dev_handout
Lily pad dev_handoutLily pad dev_handout
Lily pad dev_handout
Khu棚 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.
What is arduino
What is arduinoWhat is arduino
What is arduino
vivek kumar
Presentation of online Internship Program on Arduino completed at INTERNSHALA
Presentation of online Internship Program on Arduino completed at INTERNSHALAPresentation of online Internship Program on Arduino completed at INTERNSHALA
Presentation of online Internship Program on Arduino completed at INTERNSHALA
AviPatel16612
Introduction to Arduino 16822775 (2).ppt
Introduction to Arduino 16822775 (2).pptIntroduction to Arduino 16822775 (2).ppt
Introduction to Arduino 16822775 (2).ppt
ansariparveen06
Arduino comic v0004
Arduino comic v0004Arduino comic v0004
Arduino comic v0004
DO!MAKERS

More from mkontopo (6)

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

Hello Arduino.

  • 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
  • 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
  • 14. Each DIGITAL OUT pin acts like a mini 5V power supply. Dont 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. Dont IDE. So they look very Processings 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 youre 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, 100s 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 youre 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 whats on the left. = Whats 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? Its 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

Editor's Notes

  • #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: \n
  • #20: 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
  • #21: \n
  • #22: \n
  • #23: \n
  • #24: 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
  • #25: If you forget, check the reference on the website.\n
  • #26: \n