Arduino - Tutorials

3y ago
61 Views
3 Downloads
4.63 MB
711 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Kamden Hassan
Transcription

ArduinosearchBuy Download Getting Started Learning Reference Hardware FAQLearningBlog » Forum » Playground »Examples Foundations Hacking LinksExamplesSee 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.ExamplesOther ExamplesSimple 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.)These are more complex examples for using particularelectronic components or accomplishing specific tasks. Thecode is included on the page.MiscellaneousTwoSwitchesOnePin: Read two switches with one I/OpinRead a Tilt SensorControlling an LED circle with a joystick3 LED color mixer with 3 potentiometersDigital I/OBlink: 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/OAnalog 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.CommunicationThese 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 LibraryTiming & MillisStopwatchComplex SensorsRead an ADXL3xx accelerometerRead an AccelerometerRead an Ultrasonic Range Finder (ultrasound sensor)Reading the qprox qt401 linear touch sensorSoundPlay Melodies with a Piezo SpeakerPlay Tones from the Serial ConnectionMIDI Output (from ITP physcomp labs) and fromSpooky ArduinoInterfacing w/ HardwareMultiply the Amount of Outputs with an LED DriverInterfacing an LCD display with 8 bitsLCD interface libraryDriving a DC Motor with an L293 (from ITPphyscomp labs).Driving a Unipolar Stepper MotorBuild your own DMX Master deviceImplement a software serial connectionRS-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

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 LibraryMotor Knob: control a stepper motor with apotentiometer.Edit Page Page History Printable View All Recent Site Changes

ArduinoBuy Download Getting Started Learning Reference Hardware FAQLearningsearchBlog » Forum » Playground »Examples Foundations Hacking LinksFoundationsThis page contains explanations of some of the elements of the Arduino hardware and software and the concepts behindthem. Page DiscussionBasicsSketch: The various components of a sketch and how they work.MicrocontrollersDigital 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 FirmwareBootloader: A small program pre-loaded on the Arduino board to allow uploading sketches.Programming TechniqueVariables: How to define and use variables.Port Manipulation: Manipulating ports directly for faster manipulation of multiple pinsEdit Page Page History Printable View All Recent Site Changes

ArduinosearchBuy Download Getting Started Learning Reference Hardware FAQLearningBlog » Forum » Playground »Examples Foundations Hacking LinksLinksArduino examples, tutorials, and documentation elsewhere on the web.Books and ManualsCommunity DocumentationTutorials 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 ationMaking 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.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 TutorialsLearn electronics using Arduino: an introduction toprogramming, input / output, communication, etc. usingArduino. By ladyada.Arduino Booklet (pdf): an illustrated guide to the philosophyand practice of Arduino.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.

Example labs from ITPSpooky Arduino: Longer presentation-format documentsintroducing Arduino from a Halloween hacking class taughtby TodBot:class 1 (getting started)class 2 (input and sensors)class 3 (communication, servos, and pwm)class 4 (piezo sound & sensors, arduino processing,stand-alone operation)Bionic Arduino: another Arduino class from TodBot, this onefocusing on physical sensing and making motion.Wiring electronics reference: circuit diagrams for connectinga variety of basic electronic components.Schematics to circuits: from Wiring, a guide to transformingcircuit diagrams into physical circuits.Examples from Tom IgoeExamples from Jeff GrayEdit Page Page History Printable View All Recent Site Changes

ArduinosearchBuy Download Getting Started Learning Reference Hardware FAQLearningBlog » Forum » Playground »Examples Foundations Hacking LinksArduino TutorialsHere you will find a growing number of examples and tutorials for accomplishing specific tasks or interfacing to otherhardware and software with Arduino. For instructions on getting the board and environment up and running, see the Arduinoguide.ExamplesDigital OutputBlinking LEDBlinking an LED without using the delay()functionSimple Dimming 3 LEDs with Pulse-WidthModulation (PWM)More complex dimming/color crossfaderKnight Rider exampleShooting starPWM all of the digital pins in a sinewavepatternDigital InputDigital Input and Output (from ITP physcomplabs)Read a PushbuttonUsing a pushbutton as a switchRead a Tilt SensorAnalog InputRead a PotentiometerInterfacing a JoystickControlling an LED circle with a joystickRead a Piezo Sensor3 LED cross-fades with a potentiometer3 LED color mixer with 3 potentiometersComplex SensorsRead an AccelerometerRead an Ultrasonic Range Finder (ultrasoundsensor)Reading the qprox qt401 linear touch sensorUse two Arduino pins as a capacitive sensorSoundPlay Melodies with a Piezo SpeakerMore sound ideasPlay Tones from the Serial ConnectionMIDI Output (from ITP physcomp labs) andfrom Spooky ArduinoInterfacing with Other SoftwareIntroduction to Serial Communication (fromITP physcomp labs)Arduino FlashArduino ProcessingArduino PDArduino MaxMSPArduino VVVVArduino DirectorArduino RubyArduino CTech Notes (from the forums or playground)Software serial (serial on pins besides 0 and 1)L297 motor driverHex inverterAnalog multiplexerPower suppliesThe components on the Arduino boardArduino build processAVRISP mkII on the MacNon-volatile memory (EEPROM)BluetoothZigbeeLED as light sensor (en Francais)Arduino and the Asuro robotUsing Arduino from the command line

Interfacing w/ HardwareMultiply the Amount of Outputs with an LEDDriverInterfacing an LCD display with 8 bitsLCD interface libraryDriving a DC Motor with an L293 (from ITPphyscomp labs).Driving a Unipolar Stepper MotorImplement a software serial connectionRS-232 computer interfaceInterface with a serial EEPROM using SPIControl a digital potentiometer using SPIMultiple digital outs with a 595 Shift RegisterMultiple digital inputs with a CD4021 ShiftRegisterOther Arduino ExamplesExample labs from ITPExamples from Tom IgoeExamples from Jeff GrayEdit Page Page History Printable View All Recent Site Changes

ArduinoBuy Download Getting Started Learning Reference Hardware FAQLearningsearchBlog » Forum » Playground »Examples Foundations Hacking LinksExamples Digital I/OBlinkIn most programming languages, the first program you write prints "hello world" to the screen. Since an Arduino boarddoesn't have a screen, we blink an LED instead.The boards are designed to make it easy to blink an LED using digital pin 13. Some (like the Diecimila and LilyPad) have theLED built-in to the board. On most others (like the Mini and BT), there is a 1 KB resistor on the pin, allowing you to connectan LED directly. (To connect an LED to another digital pin, you should use an external resistor.)LEDs have polarity, which means they will only light up if you orient the legs properly. The long leg is typically positive, andshould connect to pin 13. The short leg connects to GND; the bulb of the LED will also typically have a flat edge on this side.If the LED doesn't light up, trying reversing the legs (you won't hurt the LED if you plug it in backwards for a short period oftime).CircuitCodeThe example code is very simple, credits are to be found in the comments./******Blinking LED-----------turns on and off a light emitting diode(LED) connected to a digitalpin, in intervals of 2 seconds. Ideally we use pin 13 on the Arduinoboard because it has a resistor attached to it, needing only an LED** Created 1 June 2005* copyleft 2005 DojoDave http://www.0j0.org * http://arduino.berlios.de*

* based on an orginal by H. Barragan for the Wiring i/o board*/int ledPin 13;void setup(){pinMode(ledPin, OUTPUT);}void loop(){digitalWrite(ledPin, HIGH);delay(1000);digitalWrite(ledPin, LOW);delay(1000);}// LED connected to digital pin 13// sets the digital pin as output////////sets the LED onwaits for a secondsets the LED offwaits for a secondEdit Page Page History Printable View All Recent Site Changes

ArduinosearchBuy Download Getting Started Learning Reference Hardware FAQLearningBlog » Forum » Playground »Examples Foundations Hacking LinksExamples Digital I/OBlink Without DelaySometimes you need to blink an LED (or some other time sensitive function) at the same time as something else (likewatching for a button press). That means you can't use delay(), or you'd stop everything else the program while the LEDblinked. Here's some code that demonstrates how to blink the LED without using delay(). It keeps track of the last time itturned the LED on or off. Then, each time through loop() it checks if a sufficient interval has passed - if it has, it turns theLED off if it was on and vice-versa.Codeint ledPin 13;int value LOW;long previousMillis 0;long interval 1000;void setup(){pinMode(ledPin, OUTPUT);}////////LED connected to digital pin 13previous value of the LEDwill store last time LED was updatedinterval at which to blink (milliseconds)// sets the digital pin as outputvoid loop(){// here is where you'd put code that needs to be running all the time.//////ifcheck to see if it's time to blink the LED; that is, is the differencebetween the current time and last time we blinked the LED bigger thanthe interval at which we want to blink the LED.(millis() - previousMillis interval) {previousMillis millis();// remember the last time we blinked the LED// if theif (valuevalue elsevalue LED is off turn it on and vice-versa. LOW)HIGH;LOW;digitalWrite(ledPin, value);}}Edit Page Page History Printable View All Recent Site Changes

ArduinosearchBuy Download Getting Started Learning Reference Hardware FAQLearningBlog » Forum » Playground »Examples Foundations Hacking LinksExamples Digital I/OButtonThe pushbutton is a component that connects two points in a circuit when you press it. The example turns on an LED whenyou press the button.We connect three wires to the Arduino board. The first goes from one leg of the pushbutton through a pull-up resistor (here2.2 KOhms) to the 5 volt supply. The second goes from the corresponding leg of the pushbutton to ground. The thirdconnects to a digital i/o pin (here pin 7) which reads the button's state.When the pushbutton is open (unpressed) there is no connection between the two legs of the pushbutton, so the pin isconnected to 5 volts (through the pull-up resistor) and we read a HIGH. When the button is closed (pressed), it makes aconnection between its two legs, connecting the pin to gr

introducing Arduino from a Halloween hacking class taught by TodBot: class 1 (getting started) class 2 (input and sensors) class 3 (communication, servos, and pwm) class 4 (piezo sound & sensors, arduino processing, stand-alone operation) Bionic Arduino: another Arduino class from TodBot, this one focusing on physical sensing and making motion.

Related Documents:

Arduino compatible components. Personal computer running Arduino software Arduino software is free to download and use from: www.arduino.cc Arduino board Such as: Arduino Uno Freetronics Eleven Genuino Uno or any Arduino compatible board that has a standard Arduino UNO header l

arduino-00 -win.zip Recommended Path c:\Program Files\ ( - version #) Step 3: Shortcut Icon Open c:\program files\arduino-00 Right Click Arduino.exe (send to Desktop (create shortcut)) \ ( - version #) Step 4: Plug In Your Arduino Plug your Arduino in: Using the included USB cable, plug your Arduino board into a free USB port. Wait for a box to .

Hence we given interesting top five easy to make Arduino projects with code and library link. Happy learning Arduino 1. Heart Rate Monitor AD8232 Interface Arduino 2. Fingerprint sensor-scanner with Arduino 3. Giving Voice Recognition Ability to Arduino 4. Soil Moisture Sensor and Arduino 5. How to Interface RFID with Arduino?

arduino’s analog pin 4 (SDA). And the pin labelled as SCL on the MPU 6050 to the arduino’s analog pin 5 (SCL). And that’s it, you have finished wiring up the Arduino MPU 6050. Step 2: Uploading the code and testing the Arduino MPU 6050 To test the Arduino MPU 6050, first download the arduino library for MPU 6050, developed by Jeff Rowberg.

3. Then, use the Arduino IDE to write code to send to Arduino. Once a code is sent to the Arduino, it lives on the Arduino Uno. Any future edits to that code on the computer will not be sent to the Arduino unless it is manually uploaded to the Arduino Uno. When using the Arduino

117. Password access with arduino 118. Arduino Voltmeter Code 119. Easily control your iPod using Arduino 120. Candy Tossin Coffin using an Arduino 121. Arduino 7 segment Displays Digital Clock With Charlieplexing LEDs 122. Arduino controlled webcam panner 123. Binary/ Analog Clock 124. Universal Gripper

Upload your custom Arduino code with the corresponding library file 3. Add the used libraries 4. Select the used in-outputs in the Arduino IO Simulator 5. Connect the Arduino IO Simulator to the Arduino board with the right se-rial port 1. Connect the Arduino Board The Arduino IO Simulator works with a lot of

2.2.2 Arduino IDE Download and install Arduino IDE from the official web-site of Arduino. Get a version 1.6.4 or newer. It is important that the Arduino IDE version that you get has the additional boards manager. We used Arduino 1.6.6 during the preparation of this document. If you want to have the exact same behavior as us, use Arduino 1.6.6.