arduino - · pdf filearduino tutorials here you will find a growing number of examples and...

711
Arduino Buy | Download | Getting Started | Learning | Reference | Hardware | FAQ Blog » | Forum » | Playground » Learning Examples | Foundations | Hacking | Links Examples See the foundations page for in-depth description of core concepts of the Arduino hardware and software; the hacking page for information on extending and modifying the Arduino hardware and software; and the links page for other documentation. Examples Simple programs that demonstrate the use of the Arduino board. These are included with the Arduino environment; to open them, click the Open button on the toolbar and look in the examples folder. (If you're looking for an older example, check the Arduino 0007 tutorials page.) Digital I/O Blink: turn an LED on and off. Blink Without Delay: blinking an LED without using the delay() function. Button: use a pushbutton to control an LED. Debounce: read a pushbutton, filtering noise. Loop: controlling multiple LEDs with a loop and an array. Analog I/O Analog Input : use a potentiometer to control the blinking of an LED. Fading: uses an analog output (PWM pin) to fade an LED. Knock: detect knocks with a piezo element. Smoothing: smooth multiple readings of an analog input. Communication These examples include code that allows the Arduino to talk to Processing sketches running on the computer. For more information or to download Processing, see processing.org. ASCII Table : demonstrates Arduino's advanced serial output functions. Dimmer : move the mouse to change the brightness of an LED. Graph: sending data to the computer and graphing it in Processing. Physical Pixel : turning on and off an LED by sending data from Processing. Virtual Color Mixer : sending multiple variables from Arduino to the computer and reading them in Processing. EEPROM Library Other Examples These are more complex examples for using particular electronic components or accomplishing specific tasks. The code is included on the page. Miscellaneous TwoSwitchesOnePin : Read two switches with one I/O pin Read a Tilt Sensor Controlling an LED circle with a joystick 3 LED color mixer with 3 potentiometers Timing & Millis Stopwatch Complex Sensors Read an ADXL3xx accelerometer Read an Accelerometer Read an Ultrasonic Range Finder (ultrasound sensor) Reading the qprox qt401 linear touch sensor Sound Play Melodies with a Piezo Speaker Play Tones from the Serial Connection MIDI Output (from ITP physcomp labs ) and from Spooky Arduino Interfacing w/ Hardware Multiply the Amount of Outputs with an LED Driver Interfacing an LCD display with 8 bits LCD interface library Driving a DC Motor with an L293 (from ITP physcomp labs ). Driving a Unipolar Stepper Motor Build your own DMX Master device Implement a software serial connection RS-232 computer interface Interface with a serial EEPROM using SPI Control a digital potentiometer using SPI Multiple digital outs with a 595 Shift Register X10 output control devices over AC powerlines using X10

Upload: dinhanh

Post on 18-Feb-2018

219 views

Category:

Documents


1 download

TRANSCRIPT

  • ArduinoBuy | Download | Getting Started | Learning | Reference | Hardware | FAQ

    Blog | Forum | Playground

    Learning Examples | Foundations | Hacking | Links

    Examples

    See the foundations page for in-depth description of core concepts of the Arduino hardware and software; the hackingpage for information on extending and modifying the Arduino hardware and software; and the links page for otherdocumentation.

    Examples

    Simple programs that demonstrate the use of the Arduinoboard. These are included with the Arduino environment; toopen them, click the Open button on the toolbar and look inthe examples folder. (If you're looking for an olderexample, check the Arduino 0007 tutorials page.)

    Digital I/O

    Blink: turn an LED on and off.Blink Without Delay: blinking an LED without usingthe delay() function.Button: use a pushbutton to control an LED.Debounce: read a pushbutton, filtering noise.Loop: controlling multiple LEDs with a loop and anarray.

    Analog I/O

    Analog Input: use a potentiometer to control theblinking of an LED.Fading: uses an analog output (PWM pin) to fade anLED.Knock: detect knocks with a piezo element.Smoothing: smooth multiple readings of an analoginput.

    Communication

    These examples include code that allows the Arduino to talkto Processing sketches running on the computer. For moreinformation or to download Processing, see processing.org.

    ASCII Table: demonstrates Arduino's advanced serialoutput functions.Dimmer: move the mouse to change the brightnessof an LED.Graph: sending data to the computer and graphing itin Processing.Physical Pixel: turning on and off an LED by sendingdata from Processing.Virtual Color Mixer: sending multiple variables fromArduino to the computer and reading them inProcessing.

    EEPROM Library

    Other Examples

    These are more complex examples for using particularelectronic components or accomplishing specific tasks. Thecode is included on the page.

    Miscellaneous

    TwoSwitchesOnePin: Read two switches with one I/OpinRead a Tilt SensorControlling an LED circle with a joystick3 LED color mixer with 3 potentiometers

    Timing & Millis

    Stopwatch

    Complex Sensors

    Read an ADXL3xx accelerometerRead an AccelerometerRead an Ultrasonic Range Finder (ultrasound sensor)Reading the qprox qt401 linear touch sensor

    Sound

    Play Melodies with a Piezo SpeakerPlay Tones from the Serial ConnectionMIDI Output (from ITP physcomp labs) and fromSpooky Arduino

    Interfacing w/ Hardware

    Multiply the Amount of Outputs with an LED DriverInterfacing an LCD display with 8 bits

    LCD interface libraryDriving a DC Motor with an L293 (from ITPphyscomp labs).Driving a Unipolar Stepper MotorBuild your own DMX Master deviceImplement a software serial connection

    RS-232 computer interfaceInterface with a serial EEPROM using SPIControl a digital potentiometer using SPIMultiple digital outs with a 595 Shift RegisterX10 output control devices over AC powerlines usingX10

    http://www.arduino.cc/http://www.arduino.cc/en/Main/Buyhttp://www.arduino.cc/en/Main/Softwarehttp://www.arduino.cc/en/Guide/HomePagehttp://www.arduino.cc/en/Reference/HomePagehttp://www.arduino.cc/en/Main/Hardwarehttp://www.arduino.cc/en/Main/FAQhttp://www.arduino.cc/blog/http://www.arduino.cc/cgi-bin/yabb2/YaBB.plhttp://www.arduino.cc/playground/http://www.arduino.cc/en/Hacking/HomePagehttp://www.arduino.cc/en/Hacking/HomePagehttp://www.arduino.cc/en/Hacking/HomePagehttp://processing.org/http://www.arduino.cc/en/Tutotial/KeyboardSerialhttp://itp.nyu.edu/physcomp/Labs/MIDIOutputhttp://itp.nyu.edu/physcomp/Labs/Labshttp://todbot.com/blog/2006/10/29/spooky-arduino-projects-4-and-musical-arduino/http://todbot.com/blog/2006/10/29/spooky-arduino-projects-4-and-musical-arduino/http://itp.nyu.edu/physcomp/Labs/DCMotorControlhttp://itp.nyu.edu/physcomp/Labs/Labshttp://itp.nyu.edu/physcomp/Labs/Labs

  • EEPROM Clear: clear the bytes in the EEPROM.EEPROM Read: read the EEPROM and send its valuesto the computer.EEPROM Write: stores values from an analog input tothe EEPROM.

    Stepper Library

    Motor Knob: control a stepper motor with apotentiometer.

    Edit Page | Page History | Printable View | All Recent Site Changes

    http://www.arduino.cc/en/Site/AllRecentChanges

  • ArduinoBuy | Download | Getting Started | Learning | Reference | Hardware | FAQ

    Blog | Forum | Playground

    Learning Examples | Foundations | Hacking | Links

    Foundations

    This page contains explanations of some of the elements of the Arduino hardware and software and the concepts behindthem. Page Discussion

    Basics

    Sketch: The various components of a sketch and how they work.

    Microcontrollers

    Digital Pins: How the pins work and what it means for them to be configured as inputs or outputs.

    Analog Input Pins: Details about the analog-to-digital conversion and other uses of the pins.

    PWM: How the analogWrite() function simulates an analog output using pulse-width modulation.

    Memory: The various types of memory available on the Arduino board.

    Arduino Firmware

    Bootloader: A small program pre-loaded on the Arduino board to allow uploading sketches.

    Programming Technique

    Variables: How to define and use variables.

    Port Manipulation: Manipulating ports directly for faster manipulation of multiple pins

    Edit Page | Page History | Printable View | All Recent Site Changes

    http://www.arduino.cc/http://www.arduino.cc/en/Main/Buyhttp://www.arduino.cc/en/Main/Softwarehttp://www.arduino.cc/en/Guide/HomePagehttp://www.arduino.cc/en/Reference/HomePagehttp://www.arduino.cc/en/Main/Hardwarehttp://www.arduino.cc/en/Main/FAQhttp://www.arduino.cc/blog/http://www.arduino.cc/cgi-bin/yabb2/YaBB.plhttp://www.arduino.cc/playground/http://www.arduino.cc/en/Hacking/HomePagehttp://www.arduino.cc/en/Reference/PortManipulationhttp://www.arduino.cc/en/Site/AllRecentChanges

  • ArduinoBuy | Download | Getting Started | Learning | Reference | Hardware | FAQ

    Blog | Forum | Playground

    Learning Examples | Foundations | Hacking | Links

    Links

    Arduino examples, tutorials, and documentation elsewhere on the web.

    Books and Manuals

    Making Things Talk (by Tom Igoe): teaches you how to getyour creations to communicate with one another by formingnetworks of smart devices that carry on conversations withyou and your environment.

    Arduino Booklet (pdf): an illustrated guide to the philosophyand practice of Arduino.

    Community Documentation

    Tutorials created by the Arduino community. Hosted on thepublicly-editable playground wiki.

    Board Setup and Configuration: Information about thecomponents and usage of Arduino hardware.

    Interfacing With Hardware: Code, circuits, and instructionsfor using various electronic components with an Arduinoboard.

    OutputInputInteractionStorageCommunication

    Interfacing with Software: how to get an Arduino boardtalking to software running on the computer (e.g.Processing, PD, Flash, Max/MSP).

    Code Library and Tutorials: Arduino functions for performingspecific tasks and other programming tutorials.

    Electronics Techniques: tutorials on soldering and otherelectronics resources.

    Other Examples and Tutorials

    Learn electronics using Arduino: an introduction toprogramming, input / output, communication, etc. usingArduino. By ladyada.

    Lesson 0: Pre-flight check...Is your Arduino andcomputer ready?Lesson 1: The "Hello World!" of electronics, a simpleblinking lightLesson 2: Sketches, variables, procedures andhacking codeLesson 3: Breadboards, resistors and LEDs,schematics, and basic RGB color-mixingLesson 4: The serial library and binary data - gettingchatty with Arduino and crunching numbersLesson 5: Buttons & switches, digital inputs, pull-upand pull-down resistors, if/if-else statements,debouncing and your first contract product design.

    Tom Igoe's Physical Computing Site: lots of information onelectronics, microcontrollers, sensors, actuators, books, etc.

    http://www.arduino.cc/http://www.arduino.cc/en/Main/Buyhttp://www.arduino.cc/en/Main/Softwarehttp://www.arduino.cc/en/Guide/HomePagehttp://www.arduino.cc/en/Reference/HomePagehttp://www.arduino.cc/en/Main/Hardwarehttp://www.arduino.cc/en/Main/FAQhttp://www.arduino.cc/blog/http://www.arduino.cc/cgi-bin/yabb2/YaBB.plhttp://www.arduino.cc/playground/http://www.arduino.cc/en/Hacking/HomePagehttp://www.oreilly.com/catalog/9780596510510/http://www.oreilly.com/catalog/9780596510510/http://www.tinker.it/en/uploads/v3_arduino_small.pdfhttp://www.tinker.it/en/uploads/v3_arduino_small.pdfhttp://www.arduino.cc/playground/http://www.arduino.cc/playground/Main/ArduinoCoreHardwarehttp://www.arduino.cc/playground/Main/InterfacingWithHardwarehttp://www.arduino.cc/playground/Main/InterfacingWithHardware#Outputhttp://www.arduino.cc/playground/Main/InterfacingWithHardware#Inputhttp://www.arduino.cc/playground/Main/InterfacingWithHardware#Interactionhttp://www.arduino.cc/playground/Main/InterfacingWithHardware#Storagehttp://www.arduino.cc/playground/Main/InterfacingWithHardware#Communicationhttp://www.arduino.cc/playground/Main/InterfacingWithSoftwarehttp://www.arduino.cc/playground/Main/GeneralCodeLibraryhttp://www.arduino.cc/playground/Main/ElectroInfoResourceshttp://www.ladyada.net/learn/arduino/index.htmlhttp://www.ladyada.net/http://www.ladyada.net/learn/arduino/lesson0.htmlhttp://www.ladyada.net/learn/arduino/lesson1.htmlhttp://www.ladyada.net/learn/arduino/lesson2.htmlhttp://www.ladyada.net/learn/arduino/lesson3.htmlhttp://www.ladyada.net/learn/arduino/lesson4.htmlhttp://www.ladyada.net/learn/arduino/lesson5.htmlhttp://tigoe.net/pcomp/

  • Example labs from ITP

    Spooky Arduino: Longer presentation-format documentsintroduci