Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Arduino Microcontrollers

Similar presentations


Presentation on theme: "Introduction to Arduino Microcontrollers"— Presentation transcript:

1 Introduction to Arduino Microcontrollers

2 Overview Background Hardware and Software Arduino C
Microcontroller defined Why Arduino's? Hardware and Software Arduino C Electronic Circuits Projects Blinking light(s) Reading inputs (variable resistors)

3 Microcontrollers – One Definition
Programmers work in the virtual world. Machinery works in the physical world. How does one connect the virtual world to the physical world? Enter the microcontroller. A microcontroller is basically a small-scale computer with generalized (and programmable) inputs and outputs. The inputs and outputs can be manipulated by and can manipulate the physical world.

4 Microcontrollers – One Definition
A microcontroller is basically a small-scale computer with a small amount of memory and generalized (and programmable) inputs and outputs. The inputs and outputs can be manipulated by and can manipulate the physical world.

5 Why Arduino? For whatever reason, Arduino microcontrollers have become the de facto standard. Make Magazine features many projects using Arduino microcontrollers. Strives for the balance between ease of use and usefulness. Programming languages seen as major obstacle. Arduino C is a greatly simplified version of C++. Inexpensive ($35 retail).

6 Arduino Uno Close Up The pins are in three groups: 14 digital pins
6 analog pins power

7 Handling the Arduino - How NOT to Do It!
Improper Handling - NEVER!!!

8 Handling the Arduino - The Proper Way
Proper Handling - by the edges!!! Wash your hands after handling the boards. Solder contains lead (not RoHS compliant yet!)

9 Your Arduino Kit Should Include:
3 each, LEDs 1 each, Laptop 3 each, 220 W Resistors 1 each, USB cable 1 each, Breadboard 1 each, Arduino Pass out the checklists and inform students that they will be held responsible for all material lost or damaged (Unmet Obligations). The USB cable in your kit is blue, not black. The USB side plugs into the laptop and the other plugs into the Arduino board. 5 each, Jumper Wires

10 You and Your Partner Should:
Collect your Arduino Kit Inventory your kit to ensure all parts are present Complete and sign your checklist Turn in signed Checklist and sign out a Laptop Remember the # on your Laptop, you will get the same laptop each day

11 Connecting the Arduino to a Laptop/PC
Connect the Arduino UNO board to the laptop as shown in the picture to the right. One end of the cable should slide into one of the USB ports on the laptop; the other end of the cable attaches to the port on the UNO board. You should see the LED lights on the board come on when the connections are secure. Wash your hands after handling the boards. Solder contains lead (not RoHS compliant yet!)

12 Opening the Arduino Software
After you have connected your Arduino to the laptop: Look for the Arduino Software icon on the desktop of your laptop. Open the software. Find this icon on your desktop and double-click on it.

13 Opening the Arduino Software
After you have opened the Arduino software: Click on Tools->Serial Port Find and click on the Com Port being used by your Arduino Click on Tools->Board Confirm that you’re using the UNO

14 Programming - Functions
Each Arduino program is has two required functions, SETUP and LOOP. Type the code in RED below into your program if it does not already appear there. void setup ( ) { } - All of the code within the curly braces will be run ONCE when the program first runs. void loop ( ) { } - This function is run AFTER setup has finished. All of the code within the curly braces will be run again, and again, until the power is removed.

15 Programming - Functions
Each Arduino function have the same basic building blocks: an output, the function name, inputs and a place to store code. void setup ( ) { } Output Function Name Input Code Each line of code ends with a semi-colon (;).

16 Upload the code Upload your sketch by clicking on this arrow.

17 Programming - Routines
Type the code in RED below into your SKETCH. void setup ( ) { pinMode(13, OUTPUT); } The Arduino C programming language is case-sensitive. Type in the code in RED exactly as you see it!!! void loop ( ) { digitalWrite(13,HIGH); delay(1000); digitalWrite(13,LOW); }

18 Blink Challenges: Modify the code to blink the light on for 2 seconds then off for 3 seconds. Notice how bright the LED appears when it is on. Modify the code to blink the LED on for 1/10 of a second and off for 1/10 of a second. Does the LED blink? Is it as bright as before? What do you think causes the difference?


Download ppt "Introduction to Arduino Microcontrollers"

Similar presentations


Ads by Google