Exploring lighting effects with LED’s and Arduino

Slides:



Advertisements
Similar presentations
Color.
Advertisements

Anurag Dwivedi & Rudra Pratap Suman.  Open Source electronic prototyping platform based on flexible easy to use hardware and software.
Digital & Analog Inputs. Review Fundamental parts of an Arduino program are … Setting output types using pinMode. Declaring variables Can write a digital.
Living with the Lab Using Your Arduino, Breadboard and Multimeter EAS 199A Fall 2011 Work in teams of two!
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.
Introduction to Arduino Prepared by R. Lamond.  “Arduino is an open-source electronics prototyping platform based on flexible, easy- to-use hardware.
Colors – part 3 K1066BI – Graphical Design Teppo Räisänen
Basic Circuits – Lab 2 Arduino and Sensors Xmedia Spring 2011.
SNC2D. Primary LIGHT colours are red, green, and blue SECONDARY light colours are created by combining only two of the three primary colours of light.
DataInputFrom Digital PinsUsing an On/OFF button to control an LEDFrom Analog Pins Reading light intensity using a photocell and turning an LED on and.
CMYK vs. RGB Design. Primary colors The colors that make up the base for every other color created. Depending on whether you are looking at it from science,
Unleash Your Inner Inventor Using the Arduino Microcontroller For More Than You Would Expect.
Colours of light can be added together to form a variety of colours.
LECTURE 2 – INPUTS THIS LECTURE WILL INTRODUCE HOW TO INPUT SIGNALS INTO AN ARDUINO.
# Red Green Blue Digital Color RGB to HEX.
Ch 6 Color Image processing CS446 Instructor: Nada ALZaben.
PRIMARY COLOURS Primary Colours: The 3 primary colours are red, yellow and blue. They are three colours that can't be made by mixing any other colours,
Lecture 24: Color Announcements & Review Lab 7 Due Thursday 2 D arrays - embedding graphs in an array Computer Science Artifacts Abstraction Representations.
Computer Science and Software Engineering© 2014 Project Lead The Way, Inc. Bits and Bytes.
PART TWO Electronic Color & RGB values 1. Electronic Color Computer Monitors: Use light in 3 colors to create images on the screen Monitors use RED, GREEN,
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.
Motor TYWu.
Final Term Project Hi-Tek Smoke Detektor By: Rohan Sharma.
RGB LED 燈條實驗.
Seeing in colour Stare at the coloured dot in the middle of the next picture for a minute. Then describe what you see when you look at the next slide.
Programming in Arduino Materials:Arduino Board Casperelectronics Pre Pres. Notes Photos from workshop?
Arduino + Bluetooth TYWu. Connection Arduino + Bluetooth Module.
Computer Graphics: Achromatic and Coloured Light.
Pulse-Width Modulation: Simulating variable DC output
1 of 32 Computer Graphics Color. 2 of 32 Basics Of Color elements of color:
ECE Group Members Samantha Starr BME Arduino Arianna Weinshel BME Sensors, Circuits Eden Woldemichael CE AM Radio Taylor Brooke EE Instrumentation,
INTERNET OF EVERYTHING SDU 2016 Week 8. Visual Output  Lets the Arduino show off  Arduino supports a broad range of LED devices  Use digital and analog.
ME 120: Arduino PWM Breathing LED Code: Implementation on Arduino ME 120 Mechanical and Materials Engineering Portland State University
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.
Breadboards and LED’s with Arduino
Assist. Prof. Rassim Suliyev - SDU 2017
Microcontroller basics
More on LED’s with Arduino
25.2 The human eye The eye is the sensory organ used for vision.
The Colour of Light: Additive colour theory.
Additive Colour Theory
Subtractive colour theory
Colour theory.
Cascade switching of an LED
Welcome to Arduino A Microcontroller.
Get Your Project Started with Arduino
Exploring more with LED’s and Arduino
Sensors with Arduino A Microcontroller.
3.0 ARDUINO WORKSHOP PRESENTATION FOR STUDENTS IN 4º DEGREE OF COMPULSORY SECONDARY EDUCATION 3.0.
Arduino.
Въведение в Arduino.
Control the color and brightness of an RGB LED with a Potentiometer
RGB LEDs.
Seeing in colour Stare at the coloured dot in the middle of the next picture for a minute. Then describe what you see when you look at the next slide.
Basic Graphics Drawing Shapes 1.
Arduino 101 Credit(s):
CS-4540 Robotics - Lab 05 Switch inputs to the Arduino Uno
Colour Theories.
Game Controller Introduction.
CS4101 Introduction to Embedded Systems Lab 8: Arduino DAC and PWM
Last of the LED’s and Arduino
Colour theory.
Two ways to discuss color 1) Addition 2) Subtraction
Chapter 1 Introduction of Arduino
Color and Shading Lecture 9 Mon, Sep 26, 2005.
Multiplexing seven-segment displays
Arduino Uno circuit basics
Arduino程式範例.
Pulse-Width Modulation: Simulating variable DC output
Section 3.4 The Colors of Light.
Presentation transcript:

Exploring lighting effects with LED’s and Arduino A Microcontroller

Exercise 8 - RGB Mood lamp Try a white paper cylinder around the LED’s for a better visual effect (maybe even put some pictures on it, or cut some shapes into it)

RGB Mood lamp script //Exercise 8 RGB Mood lamp // Sourced from McRoberts, Michael. 'Beginning Arduino. 2nd Ed.' Project 8 float RGB1[3]; float RGB2[3]; float INC[3]; int red, green, blue; int RedPin = 11 int GreenPin = 10 int BluePin = 9 void setup() { randomSeed(analogRead(0)); RGB1[0] = 0; RGB1[1] = 0; RGB1[2] = 0; RGB2[0] = random(256); RGB2[1] = random(256); RGB2[2] = random(256); } void loop() { for (int x=0; x<3; x++) { INC[x] = (RGB1[x] - RGB2[x])/256; } for (int x=0; x<256; x++) { red = int(RGB1[0]); green = int(RGB1[1]); blue = int(RGB1[2]); analogWrite (RedPin, red); analogWrite (GreenPin, green); analogWrite (BluePin, blue); delay(100); RGB1[0] -= INC[0]; RGB1[1] -= INC[1]; RGB1[2] -= INC[2]; RGB2[x] = random(556)-300; RGB2[x] = constrain(RGB2[x], 0, 255); delay(1000);

Notes on the RGB script randomSeed create a random number (Arduino’s however are bad at this, its not so random, a short coming of being a digital computer). The ‘seed’ sets a starting point to start counting from (in this case uses random noise on pin A0) Once we have a ‘seed’ we use the random function to generate a number from 0 to 255 (or any number range we set) INC – increment, to gradually change the values Colours – we use RGB for computer and TV screens

Colours Red Green Blue Colour 255 Yellow Cyan Magenta White

Notes on the code Once we have a colour we need to make sure it isn’t a faded colour Random(556)-300 – We are trying to force primary colours so as to avoid washed out shades Constrain(RGB2[x], 0, 255)); - this constrains the results of the above line to a range of 0 to 255 (no negatives) tp push it back into the visible range of colours we want

Exercise 9 - LED Fire effect

Fire effect script // Exercise 9 - Fire effect // Sourced from McRoberts, Michael. 'Beginning Arduino. 2nd Ed.' Project 9 int ledPin1 = 9; int ledPin2 = 10; int ledPin3 = 11; void setup() { pinMode(ledPin1, OUTPUT); pinMode(ledPin2, OUTPUT); pinMode(ledPin3, OUTPUT); } void loop() analogWrite(ledPin1, random(120)+135); analogWrite(ledPin2, random(120)+135); analogWrite(ledPin3, random(120)+135); delay(random(100));

Notes on the code: Random(120)+135 -> this gives us a random value, plus a value to ensure that the LED’s are bright The delay in milliseconds is also random, between ON and 100ms to create the flicker effect