LAB1 TYWU. Devices Dip Switch (4 Switches) Triple Output LED (RGB) –Common Cathode.

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 6 Digital Inputs
ARDUINO CLUB What we’re really doing. BASICS The setup() and loop() functions.
Lab7: Introduction to Arduino
Intermediate Electronics and Lilypad Where Electronics Meet Textiles Workshop with Lynne Bruning and Troy Robert Nachtigall Sponsored by Spark Fun and.
Anurag Dwivedi & Rudra Pratap Suman.  Open Source electronic prototyping platform based on flexible easy to use hardware and software.
Basic DC Motor Circuits
Panasonic EVE-KC2F2024B 24 pulses per revolution 6mm diameter flattened output shaft output type: quadrature (incremental) minimum life: 15,000 rotations.
Intro to the Arduino Topics: The Arduino Digital IO Analog IO Serial Communication.
Digital & Analog Inputs. Review Fundamental parts of an Arduino program are … Setting output types using pinMode. Declaring variables Can write a digital.
Intro to Arduino with LilyPad Make a MakerSpace, Artisan’s Asylum Linz Craig, Chris Taylor, Mike Hord & Joel Bartlett.
Analog and Digital Measurements living with the lab 14 digital input / output pins 6 analog input pins © 2011 LWTL faculty team.
Basic Circuits – Lab 2 Arduino and Sensors Xmedia Spring 2011.
ARDUINO PROGRAMMING Working with the Arduino microcontroller.
Arduino Part 2 Topics: Serial Communication Programming Constructs: functions, loops and conditionals Digital Input.
Basic Circuits – Lab 2 Arduino and Sensors
Image of Arduino. Arduino discussion Address issues with circuit walk-through – Electricity, Programming, Arduino Concepts Work on BeatTable (next week)
Lecture 9: Microcontrollers – part 1 BJ Furman 29OCT2012.
Microprocessors Tutorial 1: Arduino Basics
ProtoSnap Introduction to Arduino Casey Haskell, Pete Lewis, David Stillman, Jim Lindblom, Pete Dokter, Lindsay Levkoff, Trevor Zylstra.
Khaled A. Al-Utaibi  The Push Button  Interfacing Push Buttons to Arduino  Programming Digital Inputs  Working with “Bouncy”
Cascade switching of an LED EAS 199B Winter 2013.
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.
Code The Arduino Environment.
Warmup – 16FEB2012 This one is for practice. I have paper if you need it. Suppose there are eight, single-pole, single-throw (SPST) switches connected.
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.
Lecture 10: Peripherals Bryan Burlingame 04 November 2015.
A3144 SENSITIVE HALL-EFFECT SWITCHES & AH Linear Hall sensor
Microcontroller Hands-on Workshop #2 Ahmad Manshad New Mexico State University Institute of Electrical and Electronics Engineers October 31, 2009.
Line following tips photoresistors positioned near floor photoresistor circuits © 2011 LWTL faculty team living with the lab.
Arduino libraries Datatekniker Udvidet hardware/software.
Photoresistor resistance changes dramatically with light level living with the lab Using Photoresistors with an Arduino © 2011 LWTL faculty team.
Temperature Sensor TYWu. Seeed’s Temperature Sensor Picture.
Week 5: Microcontrollers & Flow Control Bryan Burlingame 2 March 2016.
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.
Arduino + Bluetooth TYWu. Connection Arduino + Bluetooth Module.
Arduino “Getting Started” Instructor : Dr Matthew Miss Khin Yi Kyaw
Pulse Width Modulation Instructor Dr Matthew Khi Yi Kyaw.
[LAB 2] Cloud9 IDE  Cloud9 IDE introduction  Example and Exercise.
Microcontroller basics
Sensors with Arduino A Microcontroller.
Cascade switching of an LED
Callback TYWu.
European Robotic LABoratory
UCD ElecSoc Robotics Club 2017/2018
Lab 1: Arduino Basics Topics: Arduino Fundamentals, First Circuit
INC 161 , CPE 100 Computer Programming
Lecture 2-2: Arduino Programming
Arduino.
Control the color and brightness of an RGB LED with a Potentiometer
Arduino Uno and sensors
Analog Input through POT
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.
Chapter 2 Push button and Potentiometer
1 Code
CS-4540 Robotics - Lab 05 Switch inputs to the Arduino Uno
Implementing Switches Using Interrupts
Topics: Programming Constructs: loops & conditionals Digital Input
Programming 2: The Arduino IDE & First Sketches
Arduino Practice: Photoresistors, PWM, Potentiometers, Motors
CTY SAR FCPS Shawn Lupoli, Elliot Tan
CTY SAR FCPS Shawn Lupoli, Elliot Tan
Arduino 7 Segment Display Lab
Arduino Uno circuit basics
Introduction to Arduinos
Arduino程式範例.
Arduino UMBC IEEE Sekar Kulandaivel Week 3: Motor Control w/ H-Bridges
Presentation transcript:

LAB1 TYWU

Devices Dip Switch (4 Switches) Triple Output LED (RGB) –Common Cathode

Specification Controller Luminance (Blink Mode)

Photo Arduino

Instruction analogWrite – rite

.pde #define SW1 7 #define SW2 6 #define SW3 5 #define SW4 4 #define SW1 7 #define SW2 6 #define SW3 5 #define B 9 // Analog Pin 0 #define G 10 // Analog Pin 1 #define R 11 // Analog Pin 2 #define BLINK_FACTOR 30 // Analog Pin 2

.pde int cnt = 0; int luma = 1; void setup() { pinMode(SW1, INPUT); pinMode(SW2, INPUT); pinMode(SW3, INPUT); pinMode(SW4, INPUT); pinMode(B, OUTPUT); pinMode(G, OUTPUT); pinMode(R, OUTPUT); digitalWrite(SW1, HIGH); // turn on pullup resistors digitalWrite(SW2, HIGH); // turn on pullup resistors digitalWrite(SW3, HIGH); // turn on pullup resistors digitalWrite(SW4, HIGH); // turn on pullup resistors Serial.begin(9600); }

.pde void loop() { if(digitalRead(SW1)==HIGH) cnt = (cnt + 1) % BLINK_FACTOR; if(digitalRead(SW2)==HIGH) analogWrite(B, luma); else analogWrite(B, 0); if(digitalRead(SW3)==HIGH) analogWrite(G, luma); else analogWrite(G, 0); if(digitalRead(SW4)==HIGH) analogWrite(R, luma); else analogWrite(R, 0); if(cnt == 0 && digitalRead(SW1)==HIGH) luma=luma * 2; if(luma > 128) luma = 1; Serial.print(luma, DEC); Serial.println(""); }

Exercise Add another LED Generate the Complement Color of the Original LED