Introduction to Arduino Microcontrollers

Slides:



Advertisements
Similar presentations
ARDUINO CLUB What we’re really doing. BASICS The setup() and loop() functions.
Advertisements

Lab7: Introduction to Arduino
Embedded Sumo 1T4 – 1T5 UTRA.
Re-programming the Simon Says with Arduino Linz Craig, Brian Huang.
Intro to the Arduino Topics: The Arduino Digital IO Analog IO Serial Communication.
Living with the Lab Using Your Arduino, Breadboard and Multimeter EAS 199A Fall 2011 Work in teams of two!
1 Arduino Board: Arduino UNO Arduino Programing Environment: Arduino 0022
1 Introduction to Coding. 2 Example Codes A lot of example codes are given with Arduino IDE A code can often be based on a previous example rather than.
Introduction to Arduino Prepared by R. Lamond.  “Arduino is an open-source electronics prototyping platform based on flexible, easy- to-use hardware.
Embedded Programming and Robotics
Working with Arduino: Lesson #1: Getting Acquainted with the Kit EGN1007.
Arduino Part 1 Topics: Microcontrollers Programming Basics: structure and variables Digital Output Analog to Digital Conversion.
Colorado Space Grant Consortium Gateway To Space ASEN 1400 / ASTR 2500 Class #12 Gateway To Space ASEN 1400 / ASTR 2500 Class #12 T-58.
Dean Brock, Rebecca Bruce and Susan Reiser, CCSC SE 2009 Using Arduino Material taken from Todbot blog Bionic Arduino Todbot blog Bionic ArduinoTodbot.
Intro to the Arduino Topics: The Arduino Digital IO
Ballooning Bundle. What is a Microcontroller? Small computer with a processor core, memory and programmable input/output Continuously repeats software.
Arduino. What is it? A open-source software suite and single-board microcontroller. Allows easy and affordable prototyping of microcontroller applications.
Tweaking Your Simon Adding a photoresistor and changing code Instruction by Pete Lewis and Linz Craig.
1 - Remove LED from 13 and GND - Bring out your breadboard from HW#4 Arduino Overview:
Arduino Training New Mexico Mathematics, Engineering, and Science Achievement (NM MESA) Getting Started.
1 Introduction to Haptics Introduction to the Hapkit board Allison M. Okamura Stanford University.
Arduino “Getting Started” Instructor : Dr Matthew Miss Khin Yi Kyaw
1 Introduction to Coding. 2 Example Codes A lot of example codes are given with Arduino IDE A code can often be based on a previous example rather than.
Having fun with code, using Arduino in a middle school CS classroom
Arduino.
Arduino Part 1 Topics: Microcontrollers
INTRODUCTION TO ROBOTICS Part 5: Programming
By Rick Darby Sponsors: Geekspace Gwinnett The WorkSpot
Microcontroller basics
Val Manes Department of Math & Computer Science
Downloading Arduino FOR WINDOWS.
Microcontroller basics
Introduction to the Arduino
Intro to the Arduino Created by
UTA010 : Engineering Design – II
An Arduino Workshop A Microcontroller.
Welcome to Arduino A Microcontroller.
Get Your Project Started with Arduino
Arduino Development for Beginners
UCD ElecSoc Robotics Club 2017/2018
Arduino Part 1 Topics: Microcontrollers Programming Basics
INC 161 , CPE 100 Computer Programming
Introduction to Arduino Microcontrollers
Lighting LEDs with a RASPBERRY PI
Arduino and Grove LET’S START.
Roller Coaster Design Project
Roller Coaster Design Project
ARDUINO     What is an Arduino? Features 14 Digital I/O pins 6 Analogue inputs 6 PWM pins USB serial 16MHz Clock speed 32KB Flash memory 2KB SRAM.
FeMaidens Programming
Intro to the Arduino Topics: The Arduino Digital IO
Arduino 101 Credit(s):
using the Arduino to make LEDs flash
Working with Arduino: Lesson #1: Getting Acquainted with the Kit
Welcome to Digital Electronics using the Arduino Board
Chapter 1 Introduction of Arduino
Intro to the Arduino by Someet Singh
Arduino Part 4 Let there be more light.
CTY SAR FCPS Shawn Lupoli, Elliot Tan
I/O Programming with Arduino
Having fun with Arduino
Aeroponic Engineering and Vertical Farming
Arduino Leonardo Setup
Lab #1: Getting Started.
Arduino Uno circuit basics
Introduction to Arduino
Arduino and Grove LET’S START.
Introduction to Arduinos
SAURABH GINGADE.
Introduction to arduino
Introduction to Arduino IDE and Software
Presentation transcript:

Introduction to Arduino Microcontrollers

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.

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.

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

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

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!)

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

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

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!)

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. Click on Tools->Serial Port Find and click on the Com Port being used by your Arduino

Select Serial Port and Board

Programming - Routines Each Arduino program is called a SKETCH and has two required functions, called ROUTINES. Type the code in RED below into your SKETCH. 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.

Arduino IDE Name of sketch Compile sketch Upload to board Serial Monitor Program area Save New Open Messages and errors

A Little Bit About Programming Code is case sensitive Statements are commands and must end with a semi-colon Comments follow a // or begin with /* and end with */ loop and setup

Digital I/0 pinMode(pin, mode) digitalRead(pin) www.mikroe.com/chapters/view/1 pinMode(pin, mode) Sets pin to either INPUT or OUTPUT digitalRead(pin) Reads HIGH or LOW from a pin digitalWrite(pin, value) Writes HIGH or LOW to a pin Electronic stuff Output pins can provide 40 mA of current Writing HIGH to an input pin installs a 20KΩ pullup

Terminology

Arduino Timing delay(ms) delayMicroseconds(us) Pauses for a few milliseconds delayMicroseconds(us) Pauses for a few microseconds More commands: arduino.cc/en/Reference/HomePage

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

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); }

Notes: Resistor is needed to limit current Resistor and LED may be interchanged (but polarity of LED is important) Pin 13 is special: has built-in resistor and LED Change program and upload

Write “Blink” code Compile, then upload the program Congratulations! You are now blinkers!

Status Messages todbot.com/blog/bionicarduino

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?

Digital? Analog? Digital has two values: on and off Analog has many (infinite) values Computers don’t really do analog, they quantize Remember the 6 analog input pins---here’s how they work todbot.com/blog/bionicarduino