Introduction to Arduinometrixcreate.wdfiles.com/local--files/workshops/Intro_to... ·...

20
Introduction to Arduino Instructor: Plamena Milusheva November 16, 2013

Transcript of Introduction to Arduinometrixcreate.wdfiles.com/local--files/workshops/Intro_to... ·...

Page 1: Introduction to Arduinometrixcreate.wdfiles.com/local--files/workshops/Intro_to... · 2013-11-16 · Introduction to Arduino. Instructor: Plamena Milusheva. November 16, 2013. Set

Introduction to Arduino

Instructor: Plamena Milusheva

November 16, 2013

Page 2: Introduction to Arduinometrixcreate.wdfiles.com/local--files/workshops/Intro_to... · 2013-11-16 · Introduction to Arduino. Instructor: Plamena Milusheva. November 16, 2013. Set

Set up: Drivers and IDE

Page 3: Introduction to Arduinometrixcreate.wdfiles.com/local--files/workshops/Intro_to... · 2013-11-16 · Introduction to Arduino. Instructor: Plamena Milusheva. November 16, 2013. Set

Some Arduino applications:

…and so much more!

Page 4: Introduction to Arduinometrixcreate.wdfiles.com/local--files/workshops/Intro_to... · 2013-11-16 · Introduction to Arduino. Instructor: Plamena Milusheva. November 16, 2013. Set

Microcontroller: The brain of your Arduino

ATmega328

Miniature computerprocessorlong term memory(program storage)short term memory(calculations)

Input and Outputdigital (binary: High, Low)analog (data sequence)

Page 5: Introduction to Arduinometrixcreate.wdfiles.com/local--files/workshops/Intro_to... · 2013-11-16 · Introduction to Arduino. Instructor: Plamena Milusheva. November 16, 2013. Set

What makes your Arduino Uno board work:

Runs at 16 MHz

32 KB Flash memory

2 KB RAM (for calculations)

1 KB EEPROM (re-writable read-only memory)

14 Digital Input/Output pins

6 Analog Input pins

Page 6: Introduction to Arduinometrixcreate.wdfiles.com/local--files/workshops/Intro_to... · 2013-11-16 · Introduction to Arduino. Instructor: Plamena Milusheva. November 16, 2013. Set

The essentials of the Arduino board

Page 7: Introduction to Arduinometrixcreate.wdfiles.com/local--files/workshops/Intro_to... · 2013-11-16 · Introduction to Arduino. Instructor: Plamena Milusheva. November 16, 2013. Set

The Arduino IDE

Page 8: Introduction to Arduinometrixcreate.wdfiles.com/local--files/workshops/Intro_to... · 2013-11-16 · Introduction to Arduino. Instructor: Plamena Milusheva. November 16, 2013. Set

Basic button controls

Page 9: Introduction to Arduinometrixcreate.wdfiles.com/local--files/workshops/Intro_to... · 2013-11-16 · Introduction to Arduino. Instructor: Plamena Milusheva. November 16, 2013. Set

Library of Arduino code

Page 10: Introduction to Arduinometrixcreate.wdfiles.com/local--files/workshops/Intro_to... · 2013-11-16 · Introduction to Arduino. Instructor: Plamena Milusheva. November 16, 2013. Set

Getting your Arduino to do things…

*You may need to change the rate of the serial monitor to 57600 in order to get a read.

Setup () function:Runs once at beginning of program execution

Loop () function:Loops the dynamic elements of the program

Page 11: Introduction to Arduinometrixcreate.wdfiles.com/local--files/workshops/Intro_to... · 2013-11-16 · Introduction to Arduino. Instructor: Plamena Milusheva. November 16, 2013. Set

Breadboards

=… …

Page 12: Introduction to Arduinometrixcreate.wdfiles.com/local--files/workshops/Intro_to... · 2013-11-16 · Introduction to Arduino. Instructor: Plamena Milusheva. November 16, 2013. Set

Digital Output: Make and LED blink

Page 13: Introduction to Arduinometrixcreate.wdfiles.com/local--files/workshops/Intro_to... · 2013-11-16 · Introduction to Arduino. Instructor: Plamena Milusheva. November 16, 2013. Set

Digital Output: Code

Play around with the delay length

Create a variable blinking sequence

Add more LEDS

Page 14: Introduction to Arduinometrixcreate.wdfiles.com/local--files/workshops/Intro_to... · 2013-11-16 · Introduction to Arduino. Instructor: Plamena Milusheva. November 16, 2013. Set

Digital Input: Controlling your LED with a button

Page 15: Introduction to Arduinometrixcreate.wdfiles.com/local--files/workshops/Intro_to... · 2013-11-16 · Introduction to Arduino. Instructor: Plamena Milusheva. November 16, 2013. Set

Digital Output: Code

How IF statements work

Switch the result produced by pressing the button

== vs. =

Page 16: Introduction to Arduinometrixcreate.wdfiles.com/local--files/workshops/Intro_to... · 2013-11-16 · Introduction to Arduino. Instructor: Plamena Milusheva. November 16, 2013. Set

Analog Input: Reading a variable resistor using Serial

Page 17: Introduction to Arduinometrixcreate.wdfiles.com/local--files/workshops/Intro_to... · 2013-11-16 · Introduction to Arduino. Instructor: Plamena Milusheva. November 16, 2013. Set

Analog Input serial read: Code

Page 18: Introduction to Arduinometrixcreate.wdfiles.com/local--files/workshops/Intro_to... · 2013-11-16 · Introduction to Arduino. Instructor: Plamena Milusheva. November 16, 2013. Set

Analog Input: Controlling LED with a potentiometer

Page 19: Introduction to Arduinometrixcreate.wdfiles.com/local--files/workshops/Intro_to... · 2013-11-16 · Introduction to Arduino. Instructor: Plamena Milusheva. November 16, 2013. Set

Analog Input: Code

Page 20: Introduction to Arduinometrixcreate.wdfiles.com/local--files/workshops/Intro_to... · 2013-11-16 · Introduction to Arduino. Instructor: Plamena Milusheva. November 16, 2013. Set

Expanding the capabilities of the Arduino board

Using external power suppliesUSB vs. DC adapterVin pin vs. 5V pin

Using shields: modular pre-made circuit boards for various functions (touch screen, ethernet, blue tooth, and much more)