Class Notes (836,634)
Canada (509,867)
IAT 267 (14)
Lecture 5

IAT267_Week 5.docx

7 Pages
97 Views
Unlock Document

Department
Interactive Arts & Tech
Course
IAT 267
Professor
Helmine Serban
Semester
Summer

Description
Arduino Microcontroller-small, inexpensive computing device -usually employed for sensing input from the real world and controlling devices based on that input -easy to use with simple sensors and output devices 3 Separate Tools 1) Arduino Controller -the hardware 2) Arduino Working Environment -simple open source IDE built in Java 3) Language and Compiler -create code for the microcontroller Extends the Computer System Arduino is a tool for enabling computers to sense and control more of the physical world How Arduino can be used Develop interactive objects Take inputs from a variety of switches or sensors Control a variety of lights, motors, and other physical outputs -can be stand along or can communicate with software running on the computer E.g. Flash, Processing, MaxMSP Why Use Arduino Inexpensive Cross-platform -runs on Windows, Mac OSX, and Linux operating systems Simple, clear programming environment Arduino Board Components of the Arduino Board Digital pins-2 to 13 Analog pins-0 to 5 Arduino uses the Atmel ATMega microcontroller Has a USB port to communicate with a computer Reset button TX/RX LEDs Connection for external power supply (9 to 12V DC) Flow Control-How Arduino Reads a Program 1) Connect Arduino to computer via USB board 2) Select the correct board and serial port under ‘Tools’ menu in the Ardunio software 3) Edit code 4) Compile 5) Upload Arduino (and a microcontroller in general) reads a program from the top down The Arduino language is called ‘Wiring’ There are reserved words-keywords Programs for Arduino are called sketches There are three sections in a sketch-initialization, setup, and loop The Arduino Language Blink Example LED connected to digital pin13-pin13 has a build in LED LEDs have polarity which means they will only light up if the two pins are oriented properly -longer pin to pin13 -shorter pin to ground Program Structure All Arduino program runs in two parts  setup()-preparation  loop()-execution In the setup section, always at the top of the program, is it used to set up pin modes, initialize serial communication, etc. The loop section is the code to be executed-reading inputs, triggering outputs, etc. The third part (initialization), at the beginning of the code is optional and is not always needed The setup() statement The first thing called in an Arduino application -some devices need to be initialized when the microcontroller starts up All applications must have a setup() method, even if nothing is done in it -the compiler will check for this method, and if it is not defined, an error will occur The loop() method Contains anything that needs to happen repeatedly in the application -checking for a new value from an input -sending a signal to a pin -sending debug information Any instructions in this method will run repeatedly until the application is terminated Initialization-contains all the variables and values that will be used throughout the program Setup-contains the code to configure the pin for the button
More Less

Related notes for IAT 267

Log In


OR

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


OR

By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.


Submit