Lecture 1 – Arduino Basics

Slides:



Advertisements
Similar presentations
EMS1EP Lecture 4 Intro to Programming Dr. Robert Ross.
Advertisements

Lab7: Introduction to Arduino
ARDUINO FRAMEWORK.
Anurag Dwivedi & Rudra Pratap Suman.  Open Source electronic prototyping platform based on flexible easy to use hardware and software.
What is Arduino?  Arduino is a ATMEL 168 micro-controller kit designed specially for small projects  User friendly IDE(Integrated Development Environment)
Embedded Sumo 1T4 – 1T5 UTRA.
Re-programming the Simon Says with Arduino Linz Craig, Brian Huang.
Intel Galileo Gen 2 & Grove Seeed Starter Kit Gen 1
Beginning Arduino Session 2 AN INTRODUCTION TO HACKING THE WORLD’S MOST POPULAR MICROCONTROLLER PLATFORM
Introduction.
Embedded Programming and Robotics Lesson 2 C Programming Refresher C Programming1.
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
Arduino John Marcoux Christopher Lesch Thomas Dodge Unless otherwise noted, all information and pictures came from:
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.
Department of Electronic & Electrical Engineering Embedded system Aims: Introduction to: Hardware. Software Ideas for projects ? Robotics/Control/Sensors.
2.0 EMBEDDED CONTROLLER Engr. Hj. Mohamad Fauzi bin Zakaria Department of Mechatronics and Robotics Engineering Faculty of Electrical and Electronic Engineering.
Arduino Josh Villbrandt February 4, Digital Circuits Analog versus digital – What’s the difference? – How to represent an analog signal in a computer?
Daniel Pickem and Rowland O’Flaherty 12/04/2012 Mechatronics (ME 6405) Student Lecture On Arduinos *Some slides courtesy of Eoin Brazil
ProtoSnap Introduction to Arduino Casey Haskell, Pete Lewis, David Stillman, Jim Lindblom, Pete Dokter, Lindsay Levkoff, Trevor Zylstra.
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
Arduino 101 Instructors: Ted Markson / Jim Sweeney.
Franz Duran INTRODUCTION TO A RDUINO PROGRAMMING & INTERFACING Engr. Franz Duran, MEP-ECE RapidSignal Electronics.
Overview What is Arduino? What is it used for? How to get started Demonstration Questions are welcome at any time.
Sparkfun Electronics ATtiny85 Arduino Quick Reference Sheet
Unconventional User Interface // // Mood Based Navigation Sheo // 1Haring, Naderer, Zachhuber Arduino  Open Source Project (HW u. SW)  Analog.
LECTURE 2 – INPUTS THIS LECTURE WILL INTRODUCE HOW TO INPUT SIGNALS INTO AN ARDUINO.
SAMI MAKERSPACE MAKE: AN ELECTRONICS WORKSHOP. ARDUINO BASICS Credit to: Sparkfun and Linz Craig, Nick Poole, Prashanta Aryal, Theo Simpson, Tai Johnson,
Arduino libraries Datatekniker Udvidet hardware/software.
Microcontroller basics Embedded systems for mortals.
Lecture 9: Introduction to Arduino Topics: Arduino Fundamentals, Bean Date: Mar 22, 2016.
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.
Istituto Tecnico Industriale A.Monaco EURLAB Control a Servo Motor If you want to swing an robot arm or … steer a robot you need a special motor (Servo).
Microcontroller basics
Arduino “Getting Started” Instructor : Dr Matthew Miss Khin Yi Kyaw
Pulse-Width Modulation: Simulating variable DC output
Introduction to Mechatronics Women in Aeronautics and Astronautics (WIAA) Sponsored by Women in Engineering (WIE) Workshop Leaders: Elena Shrestha Rose.
Having fun with code, using Arduino in a middle school CS classroom
Arduino.
By Rick Darby Sponsors: Geekspace Gwinnett The WorkSpot
Microcontroller basics
Microcontroller basics
Introduction to the Arduino
UTA010 : Engineering Design – II
An Arduino Workshop A Microcontroller.
Welcome to Arduino A Microcontroller.
UCD ElecSoc Robotics Club 2017/2018
Lab 1: Arduino Basics Topics: Arduino Fundamentals, First Circuit
Arduino Part 1 Topics: Microcontrollers Programming Basics
Introduction to Arduino Microcontrollers
Arduino and Grove LET’S START.
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.
Arduino 101 Credit(s):
using the Arduino to make LEDs flash
Arduino : Introduction & Programming
Aeroponic Engineering and Vertical Farming
Introduction to Arduino
Arduino Uno circuit basics
Arduino Board.
Arduino म्हणजे काय?.
Arduino and Grove LET’S START.
Model Blimp Design Competition Programming Workshop by Youth College (International) / VTC May
Introduction to arduino
Arduino程式範例.
Introduction to Arduino IDE and Software
Presented By,  Mamata Yadav (BE Elex & Comm.) Vice R&D Coordinator(HW), PCRT  Payal Shah (BE Elex & Comm.)  Ananta Das (BE Elex & Comm.) R&D Team,PCRT.
Presentation transcript:

Lecture 1 – Arduino Basics This lecture will introduce you to the Arduino platform as well as basic programming constructs leading up to blinking leds! Presented by Sebastian Goscik

About me Name: Sebastian “The Crab” Goscik Email: sg00298@surrey.ac.uk EARS Electronics Officer Projects: ERNIE (EARS Robotic Navigator and Intrepid Explorer) EARS Ordering system Custom V-USB Development board (Arduino compatible) Android app with 500,000+ Total installs. Many more at http://www.goscik.com Volunteer work: Headstart – Weeklong course for sixthformers. ERNIE was created specifically for this event. Teaching – Such as this very class By Sebastian Goscik for EARS

What is Electronics and Amateur Radio Society Pre-Surrey society with a heritage in amateur radio and space tech Technical society with a focus on member projects and the maker community The main things we provide are our workshop (“The Shack”) and support for your projects beyond this course Email: ussu.ears@surrey.ac.uk By Sebastian Goscik for EARS

Requirements and assumptions for the course A laptop with the Arduino software installed. Windows, Mac OS X and Linux versions are available at: http://arduino.cc/en/Main/Software Windows versions may require administrator access to install drivers. As we go along, the programming constructs you need to know will be taught. If you have any issues please ask one of the demonstrators and they will be more than happy to help you. By Sebastian Goscik for EARS

Course Structure A3 - Exploring serial communication (Friday 14th November 6-8pm) UART to PC SPI (using SPI temp sensor) I2C (using I2C temp sensor) A4 - Advanced features Arduino (Friday 28th November 6-8pm) Shift register for more IO Interrupts to speed up code Timer interrupts EEPROM A5 - Final project (Friday 12th December 6-9pm) Put your newfound Arduino skills to use in the final project. A1 - Basic Arduino introduction (Wednesday 22 October 6-8pm) What is an Arduino and what can it do. IDE feature guide Explanation of Arduino sketch structure Basic programming Blink on board LED Blink an external LED A2 - Exploring other pin functions (Friday 31st October 6-8pm) Get button input to toggle a LED Analogue read using a potentiometer Analogue Write to dim a LED Tone to make sounds with a buzzer SORT INTO PAIRS By Sebastian Goscik for EARS

Kit contents 1x Breadboard 1x LED 1x RGB LED 1x Buzzer 3x 100R Resistors 1x USB Cable 1x Arduino By Sebastian Goscik for EARS

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 1KB EEPROM By Sebastian Goscik for EARS

The Arduino IDE The main features you need to know about are: Code area: This is where you will type all your code Info panel: This will show any errors during compiling or uploading code to your Arduino Verify: This allows you to compile your code to code the Arduino understands. Any mistakes you have made in the syntax of your code will be show in the info pannel Upload: This does the same as verify but will then send your code to your Arduino if the code is verified successfully Serial Monitor: This will open a window that allows you to send text to and from an Arduino. We will use this feature in later lectures. By Sebastian Goscik for EARS

The Arduino IDE By far one of the most valuable part of the Arduino software is its vast library of example programs. All features of the Arduino are demonstrated in these. Optional libraries usually add their own examples on how to use them. Arduino shields will often come with their own libraries and therefore their own examples. If these examples don’t cover what you need….Google it! By Sebastian Goscik for EARS

Before we begin coding Mention device manager for COM ports By Sebastian Goscik for EARS

Structure of an Arduino “sketch” void setup() { // put your setup code here, to run once: } void loop() { // put your main code here, to run repeatedly: Before you show the NB, switch to desktop view and do it together with them NB: A copy of this can be found in File>Examples>1. Basics>BareMinimum By Sebastian Goscik for EARS

My first sketch ( By ) int onBoardLED; void setup() { //Arduinos have an on-board LED on pin 13 onBoardLED = 13; pinMode(onBoardLED, OUTPUT); } void loop() { digitalWrite(onBoardLED, HIGH); delay(500); //delay measured in milliseconds digitalWrite(onBoardLED, LOW); delay(500); Explain then show programming Dissect the code line by line: Void = return type of the function. Tell them we will go into functions more later Setup = fuction name Int onBoardLED = 3 = A whole number variable called onBoardLED and we assign the value 13. This is like a name for a number much like algebra ; < must go on the end of every line that isn’t a function definition pinMode = digitalWrite = Comment = Delay = By Sebastian Goscik for EARS

Breadboard Breadboard get their name from old circuits that where made by putting copper nails into bread cutting boards and wire was wrapped around them By Sebastian Goscik for EARS

LEDs By Sebastian Goscik for EARS

External LEDs Try make an LED pin blink in a pattern on a pin of your choice By Sebastian Goscik for EARS

PWM – Pulse width modulation PWM allows you to create a fake analogue signal by toggling a pin high and low. The amount of overall time the pin spends high effects the average voltage of the signal. This works well for dimming LEDs so long as the frequency of pulses is faster than the eye can pick up An Arduino UNO can only do PWM on pins: 3, 5, 6, 9, 10 and 11 By Sebastian Goscik for EARS

PWM EXAMPLE int ledPin; void setup() { ledPin = 10; //Note that PWM doesn't need a pinMode } void loop() { analogWrite(ledPin, 50); delay(500); analogWrite(ledPin, 255); Let them test the code themselves By Sebastian Goscik for EARS

Loopy loop LOOOOOOOPS! For loop: Allows you to loop a certain number of times Counter initialisation Counter condition What to do when loop iteration finishes for (int counter = 0; counter<10; counter+=1) { //Do a barrel roll } By Sebastian Goscik for EARS

Loopy loop LOOOOOOOPS! While loop: Allows you to loop until a condition is met Condition while(digitalRead(10) == LOW) {     //Such loop, many iteration, WOW!, much condition met } Explain == By Sebastian Goscik for EARS

Final Challenge Task 1: Make the RBG LED cycle through 7 possible colours Task 2: Make the LEDs fade from Red > Blue > Green > RED By Sebastian Goscik for EARS