CS-4540 Robotics - Lab 05 Switch inputs to the Arduino Uno

Slides:



Advertisements
Similar presentations
Wireless Cue Light Project
Advertisements

Button Input: On/off state change Living with the Lab Gerald Recktenwald Portland State University
EMS1EP Lecture 6 Digital Inputs
Chung-Ta King National Tsing Hua University
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.
ELCT 201 week 13 Analog ON/OFF control system conversion to Digital ON/OFF control system.
Intro to Programming and Microcontrollers. Activity Group into pairs and sit back-to-back. Pick one person who is going to draw. The other person will.
Finish your programs from last week STOPLIGHT CIRCUIT! You may need … – int – void setup() – void loop() – pinMode – digitalWrite – delay.
Basic Circuits – Lab 2 Arduino and Sensors Xmedia Spring 2011.
chipKit Sense Switch & Control LED
Microcontroller Hands-on Workshop #3 Ahmad Manshad New Mexico State University Institute of Electrical and Electronics Engineers November 7, 2009.
Cascade switching of an LED EAS 199B Winter 2013.
Franz Duran INTRODUCTION TO A RDUINO PROGRAMMING & INTERFACING Engr. Franz Duran, MEP-ECE RapidSignal Electronics.
Tweaking Your Simon Adding a photoresistor and changing code Instruction by Pete Lewis and Linz Craig.
Engineering 1040: Mechanisms & Electric Circuits Winter 2015 Interfacing Light-Emitting Diodes (LEDs) & Push Buttons to Microcontrollers.
Good LED Circuit 5V0 GND. What Voltage Does Meter See? Answer: 5 V.
LECTURE 2 – INPUTS THIS LECTURE WILL INTRODUCE HOW TO INPUT SIGNALS INTO AN ARDUINO.
Arduino Circuits and Code. int ledPin = 9; void setup() { pinMode(ledPin, OUTPUT); } void loop() { digitalWrite(ledPin, LOW); delay(1000); digitalWrite(ledPin,
1 - Remove LED from 13 and GND - Bring out your breadboard from HW#4 Arduino Overview:
INTERNET OF EVERYTHING SDU 2016 Week 4. Simple Digital and Analog Inputs  The Arduino’s ability to sense digital and analog inputs allows it to respond.
Photoresistor resistance changes dramatically with light level living with the lab Using Photoresistors with an Arduino © 2011 LWTL faculty team.
Motor TYWu.
Introduction to the DE0 Board Prof. Taeweon Suh Computer Science & Engineering Korea University COSE221, COMP211 Computer Logic Design.
Microcontroller basics Embedded systems for mortals.
Microcontroller basics Embedded systems for mortals.
Robotics Grant Agreement No LLP UK-LEONARDO-LMP Project acronym: CLEM Project title: Cloud services for E-Learning in Mechatronics Technology.
LAB1 TYWU. Devices Dip Switch (4 Switches) Triple Output LED (RGB) –Common Cathode.
Arduino DC Motor Motion Control Instructor: Dr Matthew Khin Yi Kyaw.
Arduino + Bluetooth TYWu. Connection Arduino + Bluetooth Module.
ARDUINO 실습 과제 보 고서. PWM 은 아날로그 출력이라는 함수를 사용하게 되는데 이 출력에는 3, 5, 6, 9, 10, 11 번의 핀만 사용 가능. ( 숫자 옆 에 ~ 표시 )
Arduino “Getting Started” Instructor : Dr Matthew Miss Khin Yi Kyaw
1 Transistor. 2 Transistors are used to turn components on and off They come in all different shapes and sizes.
physical computing .2 – Day 3
Introducing the Arduino Uno Presented by Dave Mawdsley, DACS Member, Linux SIG Member (wiring, programming and running a cute traffic light simulation)
Having fun with code, using Arduino in a middle school CS classroom
Lab 7 Basic 1: Game of Memory
Introduction to Physical Computing
Assist. Prof. Rassim Suliyev - SDU 2017
Microcontroller basics
More on LED’s with Arduino
Microcontroller basics
Wireless Cue Light Project
Cascade switching of an LED
Welcome to Arduino A Microcontroller.
Get Your Project Started with Arduino
CS4101 Introduction to Embedded Systems Lab 1: General Purpose IO
(6. Sunu) (AVR Assembly Örnekleri)
COMP211 Computer Logic Design Introduction to the DE2 Board
European Robotic LABoratory
Lab 1: Arduino Basics Topics: Arduino Fundamentals, First Circuit
Arduino.
IoT Programming the Particle Photon.
Chapter 2 Push button and Potentiometer
Arduino 101 Credit(s):
Servos and Stepper Motors
Introducing the Arduino Uno
Button/Switch.
CS4101 Introduction to Embedded Systems Lab 8: Arduino DAC and PWM
Topics: Programming Constructs: loops & conditionals Digital Input
Programming 2: The Arduino IDE & First Sketches
Arduino Practice: Photoresistors, PWM, Potentiometers, Motors
(Dr. Öğr. Üyesi Deniz Dal)
Lab 1. Introduction to the DE2 Board
LED and a Button.
Lecture 4. Introduction to the DE2 Board
Arduino Uno circuit basics
SAURABH GINGADE.
Arduino程式範例.
Interrupts.
Presentation transcript:

CS-4540 Robotics - Lab 05 Switch inputs to the Arduino Uno https://store.arduino.cc/usa/arduino-uno-rev3

http://forum. arduino. cc/index. php/topic,146315. html http://forum http://forum.arduino.cc/index.php/topic,146315.0.html http://forum.arduino.cc/index.php?action=dlattach;topic=146315.0;attach=90365

Pull-up vs pull-down switch interface Pull up switch circuit Pull down switch circuit

Connecting a switch to an I/O pin LED connected same as before (pin 8 in this example) Add the switch circuit (pin 4 in this example) //sample switch code const int buttonPin = 4; const int ledPin =  8; int buttonState = 0; void setup() { pinMode(ledPin, OUTPUT); pinMode(buttonPin, INPUT); } void loop() {   buttonState = digitalRead(buttonPin);   if (buttonState == HIGH) {     digitalWrite(ledPin, HIGH); } else {     digitalWrite(ledPin, LOW);

Lab assignment There are only 29 kits which means each group needs to have 3.2 members per team Get the onboard LED to light when the switch is held down Get the LED to toggle with the switch – push on -> push off -> etc. Mouse button – single click -> red LED, double click -> green LED, long press -> all off. Play

References http://www.gammon.com.au/uno https://itp.nyu.edu/physcomp/lessons/microcontrollers/microcontroller-pin-functions/ http://forum.arduino.cc/index.php/topic,146315.0.html https://www.rugged-circuits.com/10-ways-to-destroy-an-arduino/ https://store.arduino.cc/usa/arduino-uno-rev3 http://www.electricrcaircraftguy.com/2014/02/arduino-power-current-and-voltage.html https://www.arduino.cc/en/Main/Software http://www.resistorguide.com/pull-up-resistor_pull-down-resistor/ https://liudr.wordpress.com/2011/10/16/sourcing-and-sinking-current/