Lecture 9: Introduction to Arduino Topics: Arduino Fundamentals, Bean Date: Mar 22, 2016.

Slides:



Advertisements
Similar presentations
Wireless Cue Light Project
Advertisements

Lecture 1 – Arduino Basics
Anurag Dwivedi & Rudra Pratap Suman.  Open Source electronic prototyping platform based on flexible easy to use hardware and software.
Embedded Sumo 1T4 – 1T5 UTRA.
Re-programming the Simon Says with Arduino Linz Craig, Brian Huang.
Digital & Analog Inputs. Review Fundamental parts of an Arduino program are … Setting output types using pinMode. Declaring variables Can write a digital.
Introduction to Arduino Programming January MER-421:Mechatronic System Design.
ELCT 201 week 13 Analog ON/OFF control system conversion to Digital ON/OFF control system.
Chapter 1 Eng. Hazem W. Marar.  Arduino is an open-source single-board microcontroller using Atmel AVR processor and an on-board I/O support.  The Arduino.
Embedded Programming and Robotics Lesson 2 C Programming Refresher C Programming1.
Basic Circuits – Lab 2 Arduino and Sensors Xmedia Spring 2011.
PROGRAMMING WITH ARDUINO. Arduino An open-source hardware platform based on an Atmel AVR 8-bit microcontroller and a C++ based IDE Over boards.
Arduino John Marcoux Christopher Lesch Thomas Dodge Unless otherwise noted, all information and pictures came from:
Daniel Pickem and Rowland O’Flaherty 12/04/2012 Mechatronics (ME 6405) Student Lecture On Arduinos *Some slides courtesy of Eoin Brazil
Arduino. What is it? A open-source software suite and single-board microcontroller. Allows easy and affordable prototyping of microcontroller applications.
Arduino 101 Instructors: Ted Markson / Jim Sweeney.
Franz Duran INTRODUCTION TO A RDUINO PROGRAMMING & INTERFACING Engr. Franz Duran, MEP-ECE RapidSignal Electronics.
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.
Suleyman Demirel University CSS340 Microprocessor Systems – Lecture 2 ATMEGA328P ARCHITECTURE ANALOG INPUTS.
ARDUINO 1. Basics  Comments  /* * Blink * * The basic Arduino example. Turns on an LED on for one second, * then off for one second, and so on... We.
Arduino Circuits and Code. int ledPin = 9; void setup() { pinMode(ledPin, OUTPUT); } void loop() { digitalWrite(ledPin, LOW); delay(1000); digitalWrite(ledPin,
Lecture 10: Peripherals Bryan Burlingame 04 November 2015.
Arduino A free development system based on Atmel AVR 8 bit microcontrollers. LB8X Tom.
Microcontrollers, Microcomputers, and Microprocessors
Photoresistor resistance changes dramatically with light level living with the lab Using Photoresistors with an Arduino © 2011 LWTL faculty team.
C# SERIAL COMMUNICATION TEMPERATURE CONTROL WITH ARDUINO KAAN EREN
Microcontroller basics Embedded systems for mortals.
Microcontroller basics Embedded systems for mortals.
1 Introduction to Haptics Introduction to the Hapkit board Allison M. Okamura Stanford University.
Programming in Arduino Materials:Arduino Board Casperelectronics Pre Pres. Notes Photos from workshop?
Arduino + Bluetooth TYWu. Connection Arduino + Bluetooth Module.
Lecture 9: Programming Beans Topics: Bean Android SDK Date: Mar 29, 2016.
Electronic instrumentation Digitization of Analog Signal in TD
Pulse-Width Modulation: Simulating variable DC output
ME 120: Arduino Programming Arduino Programming Part 1 ME 120 Mechanical and Materials Engineering Portland State University
Pulse Width Modulation Instructor Dr Matthew Khi Yi Kyaw.
Arduino Application: Speed control of small DC Motors
Hacking on Arduino George Patterson
physical computing .2 – Day 3
Harpeth Hall Jan 2016 Introduction to Arduino Prepared for Harpeth Hall Winterim January 2016.
Arduino.
Getting Started: Building & Programming
Microcontroller basics
Val Manes Department of Math & Computer Science
Microcontroller basics
Wireless Cue Light Project
Microcontroller basics
Get Your Project Started with Arduino
UCD ElecSoc Robotics Club 2017/2018
Lab 1: Arduino Basics Topics: Arduino Fundamentals, First Circuit
Arduino Part 1 Topics: Microcontrollers Programming Basics
3.0 ARDUINO WORKSHOP PRESENTATION FOR STUDENTS IN 4º DEGREE OF COMPULSORY SECONDARY EDUCATION 3.0.
Introduction to Arduinos
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.
IoT Programming the Particle Photon.
Arduino : Introduction & Programming
Programming 2: The Arduino IDE & First Sketches
Arduino Practice: Photoresistors, PWM, Potentiometers, Motors
Introduction to Arduino
Introduction to Arduino
Arduino Board.
Arduino म्हणजे काय?.
Setting up a basic program with Arduino
Arduino and Grove LET’S START.
Introduction to Arduinos
Model Blimp Design Competition Programming Workshop by Youth College (International) / VTC May
Arduino程式範例.
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.
Pulse-Width Modulation: Simulating variable DC output
Presentation transcript:

Lecture 9: Introduction to Arduino Topics: Arduino Fundamentals, Bean Date: Mar 22, 2016

References (study these)

America’s Greatest Makers Premiering Tuesday, April 5th, 2016 at 9:00pm ET/PT

What is Arduino? “Open-source prototyping platform based on easy to use HW and SW.” Inexpensive Cross-platform Simple programming environment (IDE) Open-source SW and HW

Making Stuffs using Arduino You can connect sensors and actuators, and program your Arduino to control them. Actuators (output) Sensors (input)

Arduino Uno Anatomy

Program Structure setup() – executed once at the beginning. loop() – it’s an infinite loop.

Arduino Language Reference Almost the same as C with some new things: setup() and loop() Constants: HIGH, LOW, INPUT, OUTPUT PROGMEM, EEPROM Digital/Analog input/output functions Library methods for – character, bits, interrupts, and communication.

Digital Read and Write Digital IO: HIGH or LOW int ledPin = 13; // LED connected to digital pin 13 int inPin = 7; // pushbutton connected to digital pin 7 int val = 0; // variable to store the read value void setup() { pinMode(inPin, INPUT); // sets digital pin 7 as input pinMode(ledPin, OUTPUT); // sets digital pin 13 as output } void loop() { val = digitalRead(inPin); // read the input pin (button) digitalWrite(ledPin, val); // sets the LED to the value }

Analog Read Arduino UNO has a 10-bit analog-to-digital converter, so input voltage mapped to [0, 1023] int analogPin = 3; // potentiometer middle terminal connected to analog pin 3 outside leads to ground and +5V int val = 0; // variable to store the value read void setup() { Serial.begin(9600); // setup serial } void loop() { val = analogRead(analogPin); // read the input pin Serial.println(val); // debug value }

Analog Write (PWM) Getting analog results with digital means. Must be [0, 255], and it will mean “duty cycle”. pinMode(9, OUTPUT); int X = 123; analogWrite(9, X);

Memory TYPESIZE (UNO)USEVolatile? Flash32KProgram spaceNo SRAM2KVariablesYes EEPROM1KLong term informationNo Optimizing SRAM use:  Use a connected smartphone/computer to move data out for calculation.  Use smaller data types (byte if you don’t need an int.)  Use Flash memory (PROGMEM keyword)  Use EEPROM (use EEPROM library)

Expanding Arduino with ‘Shields’ Arduino + GPS ShieldArduino + Joy Stick ShieldArduino + Xbee Shield

Variety of Arduino Boards

We will use a ‘Bean’ To get a Bean for free:

Installation/Setup Coding: Install Arduino + Bean IDE Patch (for laptop) Install DroidEdit App (coding on the phone!) Loading/Running Code on Bean: Install BeanLoader App (Phone or Laptop)

Coding and Loading: Way #1 Coding + Wireless loading Arduino studio + Bean patch + Beanloader (laptop)

Coding and Loading: Way #2 Wireless Loading Arduino studio + Bean Patch Android BeanLoader App File Copy

Coding and Loading: Way #3 Wireless Loading Android BeanLoader App File Select DroidEdit App

Let’s see BeanLoader in action