Transcription of Introduction to Arduino
1 Introduction to ArduinoApieceofcake!by Alan G. SmithSeptember 30, 2011 Cover Photo Credit: Arduino CakeCopyright 2011 Alan G. Rights made by Lisa Smith and familyIntroduction to Arduino : A piece of cake!Copyright 2011 Alan G. Smith. All Rights author can be contacted hardcopy of the book can be purchased most recent PDF is free : 1463698348 ISBN-13: 978-1463698348 This book is dedicated to:My wife who first encouraged me to teach this class andthen put up with my spending countless hours on this bookand also helped with numerous comments on the children who excite me about father who spent many hours with me on the Vic 20,Commodore 64, and the robotic arm science his investment, I wouldn t be the engineer I who would desire to make something, may this bookhelp you with your you do, work at it with all your heart, as working forthe Lord, not for 3:23 (NIV 1984) What is a Microcontroller?
2 Install the Software .. The Integrated Development Environment (IDE) .. Our first circuit .. Updated Circuit .. Our First Program .. Comments .. Gotchas .. Exercises .. Blinky .. IF Statements .. ELSE Statements .. WHILE statements .. What is truth(true)? .. Combinations .. FOR statements .. Our New Circuit .. Introducing Arrays .. Exercises .. Pushbuttons .. Potentiometers .. RGB LEDs .. Exercises .. Our Circuit .. Simple note.
3 Music .. Music with functions .. Exercises .. Serial Monitor .. Measuring the temperature .. Hooking up the LCD .. Talking to the LCD .. Bringing it all together .. Exercises .. 736 Graphics(Pictures) Binary and Hex .. Using graphics .. Making a Chart .. Exercises .. Introduction .. Photo Cell (Light Sensor) .. Tilt Sensor .. Reed Switch (Magnetic Field Detector) .. Piezo Element (Vibration sensor) .. Exercises .. One Servo .. Joystick .. Pan/Tilt bracket.
4 Adding a firing mechanism .. Exercises .. 1109 Makeyourownproject!11110 Next Structure .. Variables .. Functions .. PCD8544 (LCD Controller) Library .. First used in Chapter 1 .. First used in Chapter 2 .. First used in Chapter 3 .. First used in Chapter 4 .. First used in Chapter 5 .. First used in Chapter 6 .. First used in Chapter 7 .. First used in Chapter 8 .. Chapter 1 Solutions .. Chapter 2 Solutions .. Chapter 3 Solutions .. Chapter 4 Solutions .. Chapter 5 Solutions.
5 Chapter 6 Solutions .. Chapter 7 Solutions .. Chapter 8 Solutions .. Simplest Program .. led1 .. blink_ .. blink_ .. blink_ .. blink_ .. lightPattern1 .. lightPattern1 .. button1 .. button2 .. Constrain .. pot1 .. pot2 .. pot3 .. rgb_3 .. sound_ .. sound_2 .. sound_3 .. sound_ .. blink_if_ .. temp_ .. lcd1 .. temp_ .. temp_lcd_ .. temp_lcd_graphic_ .. reed1 .. knock1 .. servo1 .. 108xChapter 1 Getting StartedThe purpose of this book is to get you started on the road to creating thingsusing micro-controllers.
6 We will discuss only enough electronics for you tomake the circuits, and only enough programming for you to getstarted. Thefocus will be on your making things. It is my hope that as you gothrough thisbook you will be flooded with ideas of things that you can let s first question we ll start with What is a Microcontroller?Wikipedia1says:Amicro-co ntrollerisasmallcomputeronasingleintegra tedcir-cuit containing a processor core, memory, and programmablein-put/output peripheralsThe important part for us is that a micro-controller containstheprocessor(whichall computers have) and memory, and some input/output pins that you cancontrol.
7 (often called GPIO - General Purpose Input Output Pins).1 - 17 March20111 Chapter 1 Getting Started For this book, we will be using the Arduino Uno board. This combines amicro-controller along with all of the extras to make it easyfor you to buildand debug your projects. We will be using a breadboard in this book. This is a relativelyeasywayto make circuits quickly. Breadboards are made for doing quick are not known for keeping circuits together for a long time. When you areready to make a project that you want to stay around for a while,youshouldconsider an alternative method such as wire-wrapping or soldering or evenmaking a printed circuit board (PCB).
8 The first thing you should notice about the breadboard is all ofthe are broken up into 2 sets of columns and a set of rows (therows Install the Softwaredivided in the middle). The columns are named a, b, c, d, e, f, g,h,i,andj(fromleft to right). The rows are numbered 1 - 30. (from top to bottom). The columnson the edges do not have letters or columns on the edges are connected from top to bottom inside of thebreadboard to make it easy to supply power and ground. (You canthinkofground as the negative side of a battery and the power as the positive side.)
9 For this book our power will be +5 of the breadboard, the holes in each row are connectedup to the breakin the middle of the board. For Example: a1,b1,c1,d1,e1 all have a wire insideof the breadboard to connect them. Then f1, g1, h1, i1, and j1 are all a1 is not connected to f1. This may sound confusing now, butitwillquicklycome to make sense as we wire up Install the SoftwareIf you have access to the internet, there are step-by-step directions and the soft-ware available at: , the USB stick in your kit2has the software under the SoftwareDirectory.
10 There are two directories under that. One is Windows and theother is Mac OS X . If you are installing onto Linux, you will need to followthe directions at: Windows Installations1. Plug in your board via USB and wait for Windows to begin its driverinstallation process. After a few moments, the process willfail. (This isnot unexpected.)2. Click on the Start Menu, and open up the Control While in the Control Panel, navigate to System and Security. Next, clickon System. Once the System window is up, open the Device book was originally written to go along with a class.