Pages: [1]   Go Down
Author Topic: LED COLORS  (Read 480 times)
0 Members and 1 Guest are viewing this topic.
Rhode Island - USA
Offline Offline
Full Member
***
Karma: 0
Posts: 157
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello everyone, i'm brand new to Arduino and i would llike to accomplish the following..

i would like to have a button that changes a led color everytime the button is changed (ie:)

pressed 1x = red
pressed again = green
pressed again = blue
pressed again = yellow
pressed again = purple
pressed again = orange

if pressed again = red (basically starting from the beginning).. how many colors are in an led (not talking about the single color led bulbs)..

i seen a tetris table on you tube that had all colors as well as a visualizer coffee table.. so, i want to know how to control colors.

thanks in advance,
Ruffsta
Logged

Johannesburg UTC+2
Offline Offline
Faraday Member
**
Karma: 60
Posts: 3242
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Ruffsta,

Have a look at this Instructable which looks like it will answer a lot of your questions.

HTH,

Jim
Logged

Have you looked for answers in the Learning, Reference, Products and Playground tabs on http://arduino.cc/en/ ?
Look here http://electronicsclub.info/ for basic electronics

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 435
Posts: 23602
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Pick yourself up an  RGB LED do some playing.
Red, no green, no blue = Red
no red, Green, no blue = Green
no red, no green, Blue = Blue
all three = White
Red, no green, Blue  = Purple
Red, Green, no blue = Amber (sort of yellow)
Orange - Idon't know.
If you had PWM on each color, then you change the intensity of the mixed colors as well.
Say 75% red, 25% green, no blue = Orange(ish)?

So if you had an arduino, an RGB LED, 3 current limit resistors sized to not exceed the current capabiliy of  the 3 LEDs (since Red, Green, Blue typically have different forward voltages, different current limit resistors would be needed),
then connecting each to a PWM pin and using
analogWrite (RedLedPin, 196); // 0 min, 255 max
analogWrite (GreenLedPin, 64);
analogWrite (BlueLedPin, 0);
mighe yield orange for example.
Have to experiment some and see.

From there, you expand on the hardware for the size table you need, maybe with tons of chips (all LEDs capable of being driven all the time), maybe with multiplxing (one, or maybe a row or a column, are on at one time, but you switch between them all quickly to trick the eye into seeing them all as on, but maybe not quite as bright - but high brightness LEDs (blindingly bright even) can overcome that too).
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Johannesburg UTC+2
Offline Offline
Faraday Member
**
Karma: 60
Posts: 3242
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Colorpic is a useful tool to see what RGB mix you need to get what colour.
Logged

Have you looked for answers in the Learning, Reference, Products and Playground tabs on http://arduino.cc/en/ ?
Look here http://electronicsclub.info/ for basic electronics

Rhode Island - USA
Offline Offline
Full Member
***
Karma: 0
Posts: 157
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thank you very much guys.. (as for the color picker.. i code websites and already have one, but thanks tho).

i love the fast responses, i thought i was going to be waiting a few days for an answer.
Logged

Johannesburg UTC+2
Offline Offline
Faraday Member
**
Karma: 60
Posts: 3242
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i thought i was going to be waiting a few days for an answer.

The beauty of time zones on the Internet, is that there's always someone, somewhere reading the forum!
Logged

Have you looked for answers in the Learning, Reference, Products and Playground tabs on http://arduino.cc/en/ ?
Look here http://electronicsclub.info/ for basic electronics

Pages: [1]   Go Up
Jump to: