Welcome to Arduino A Microcontroller.

Slides:



Advertisements
Similar presentations
Khaled A. Al-Utaibi Interfacing an LED The Light Emitting Diode (LED) Applications DC Characteristics & Operation Interfacing to.
Advertisements

EMS1EP Lecture 4 Intro to Programming Dr. Robert Ross.
ARDUINO CLUB What we’re really doing. BASICS The setup() and loop() functions.
Lab7: Introduction to Arduino
Embedded Sumo 1T4 – 1T5 UTRA.
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.
Embedded Programming and Robotics Lesson 2 C Programming Refresher C Programming1.
Embedded Programming and Robotics
Working with Arduino: Lesson #1: Getting Acquainted with the Kit EGN1007.
chipKit Sense Switch & Control LED
Arduino. What is it? A open-source software suite and single-board microcontroller. Allows easy and affordable prototyping of microcontroller applications.
Introduction to the Arduino
Intro to Arduino Programming. Draw your circuits before you build them From Arduino 330 Ohm From Arduino 330 Ohm From Arduino 330 Ohm.
Tweaking Your Simon Adding a photoresistor and changing code Instruction by Pete Lewis and Linz Craig.
Good LED Circuit 5V0 GND. What Voltage Does Meter See? Answer: 5 V.
1 - Remove LED from 13 and GND - Bring out your breadboard from HW#4 Arduino Overview:
Microcontroller basics Embedded systems for mortals.
1 Introduction to Haptics Introduction to the Hapkit board Allison M. Okamura Stanford University.
Robotics Grant Agreement No LLP UK-LEONARDO-LMP Project acronym: CLEM Project title: Cloud services for E-Learning in Mechatronics Technology.
Programming in Arduino Materials:Arduino Board Casperelectronics Pre Pres. Notes Photos from workshop?
Introduction to Arduino A very basic intro to Arduino, the IDE and the Servos class.
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.
Introducing the Arduino Uno Presented by Dave Mawdsley, DACS Member, Linux SIG Member (wiring, programming and running a cute traffic light simulation)
Harpeth Hall Jan 2016 Introduction to Arduino Prepared for Harpeth Hall Winterim January 2016.
Having fun with code, using Arduino in a middle school CS classroom
Arduino - Introduction
Arduino.
Arduino Part 1 Topics: Microcontrollers
Getting Started: Building & Programming
Welcome to Arduino A Microcontroller.
Microcontroller basics
More on LED’s with Arduino
Val Manes Department of Math & Computer Science
Microcontroller basics
Introduction to the Arduino
UTA010 : Engineering Design – II
An Arduino Workshop A Microcontroller.
Get Your Project Started with Arduino
UCD ElecSoc Robotics Club 2017/2018
Arduino Part 1 Topics: Microcontrollers Programming Basics
INC 161 , CPE 100 Computer Programming
Arduino Uno and sensors
Introduction to Arduino Microcontrollers
Introduction to Arduino Microcontrollers
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.
Continuing with LED’s and Arduino
IoT Programming the Particle Photon.
FeMaidens Programming
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
Introducing the Arduino Uno
Last of the LED’s and Arduino
Arduino Part #3 Variables
Arduino Part 4 Let there be more light.
CTY SAR FCPS Shawn Lupoli, Elliot Tan
Arduino Motor Lab Inspired by NYU ITP project
Aeroponic Engineering and Vertical Farming
Arduino Leonardo Setup
Lab #1: Getting Started.
Arduino Uno circuit basics
Intro to Arduino Part 2 The Breadboard
SAURABH GINGADE.
Arduino程式範例.
Introduction to Arduino IDE and Software
Presentation transcript:

Welcome to Arduino A Microcontroller

Robotics at University

Weta workshop (Peter Jackson) use microcontrollers for monster animatronics This is at Wellington airport, NZ

Before we start, handling the boards… Once they are powered up please don’t touch the boards Our fingers can create a short circuit on the board and ZAP it

Make sure we are good to go…(from last lesson) Standard install, nothing complicated We need to tell the computer software what kind of Arduino we have: <Tools>, <Board>, <Arduino UNO> We need to tell the computer software where the Arduino is plugged in: <Tools>, <Port>, <comx\Arduino> for Windows OS <Tools>, <Serial Port>, <dev/ttyUSB0> for Linux OS (most likely as the UNO is the standard board, otherwise specify as required) Good to go!

‘Hello’ – of in our case Mr Blinky We are going to plug our Arduino into the computer. Then we create or load a sketch (program) and then upload it to the Arduino. A lot of software programs use a hello command as a test when you first start. The programming language we use with Arduino is called C In our case we are going to do a blink test.

Return to Exercise 1 - Blink test We load an example sketch: <File>, <Examples>, <01.Basics>, <Blink> The sketch (program) is now loaded into the window…. It will make the LED blink (Light Emitting Diode) when we upload it We are looking at….

IDE Integrated Development Environment, has 3 main parts: Tools Sketch Window Board and Serial connection details Message Window

IDE Screen dump this (CTRL + PRTSCR) or use the snipping tool (For MS Windows: click on <start>, in the <run> window type ‘snipping’ and select the app) Print the IDE out TWICE (one blank, one with the blink sketch) Stick both in your journal with room to label them Label it with the main IDE window functions

Journal entry: Will look something like… Use one to label the IDE Use the second (with blink) to label the sketch (later)

‘ello, ‘ello, ‘ello, wot ‘ave we here…. */ is a comments section // are comments (the sign of good coding practice!) Void setup is run once at the start to set up the environment Void Loop is where the sketch program is mainly written and does all the work

What does it all mean? Arduino is a 5V system pinMode sets a particular pin to be either an input or an output HIGH means ‘give all she's got Scotty’ = 5V LOW means turn ‘off’ = 0V Delay means to wait for ‘x’ milli seconds digitalWrite is a name of something

Programming Language (jargon) pinMode is an Output in this ‘blink’ example (rather than an input) HIGH and LOW are arguments. They are passed to a function when it is called. Delay is a singular argument. We can split arguments up with comma’s digitalWrite is a name of a built-in function, it needs to know where to pass the information to when it is called. We put this in parentheses {} to define what is being called. The parentheses and the code in between them are know as a block of code We then compile our code and upload it to the Arduino

Its an argument Morty, an argument…

Compile and Upload Compile/Error check Upload New Open Save Open Serial Monitor Add this to the first journal picture

IDE labels To the second IDE picture in your journal add: Void loop section Void setup section Note a comments section (*/…./*) Note a comment (//) Note an Output (or input) Note an argument (high/low) Note a singular argument (delay) Note a name (digitalwrite)

So…

Does it work? Check where the pins are plugged into Turn the LED 180o The long leg is positive

So lets mix it up What might happen when you change the delay times? Try it Change the delay time and upload it to the Arduino Observe what happens to the blink rates

Another blink test… Time to write your own code from the beginning, open the Arduino console:

Exercise 2 - Enter…. NOTE: //My 1st Project – LED flasher int ledPin = 9; Void setup() { pinMode (ledPin, OUTPUT); } Void loop() { digitalWrite(ledPin, HIGH); delay(1000); digitalWrite(ledPin, LOW); NOTE: The sketch/program is CASe sNESitive and S P A C E sensitive That is the key point of this exercise

Take the LED and…. Problem – you can burn out the LED So add a 100 Ω resistor… Connect and insert it into…. Pin 9 GND

This leads to: Adding a breadboard (note diagram uses Pin 9 like our code) More on breadboards in the next lesson.

Fritzing diagram http://fritzing.org/home/ Used this last lesson Create the diagram Save the diagram with a name such as LED project 1, LED project 2 Print the 2 diagrams Add the diagrams to your journal

This way was can add more LED’s… The next exercise we will do more things like this: http://arduino.sundh.com/