joerg_G
(joerg G)
March 3, 2015, 9:22am
1
Hi there!
I´m n newbee. And I have a problem because of not very much knowlege about programming.
The thing is quite easy I think. Ok. I have an simple rgb led. And I want to fade a self choosen color fade in and out. I declared the three Outputs but I don´t know how to define them as one color that I can fade.
It´s not really a fast led question.
But I hope that is not so dramatically.
Please help me. Some Art objects are waiting for the specified light.
thanks to everyone
Jörg
marmil
(Marc Miller)
March 3, 2015, 10:20am
2
Hi Jörg. By “simple rgb LED” do you mean an LED with 4 legs (R,G,B, and a common anode)? If so, have you looked at this example code?
#include <FastLED.h>
// Example showing how to use FastLED color functions
// even when you're NOT using a "pixel-addressible" smart LED strip.
//
// This example is designed to control an "analog" RGB LED strip
// (or a single RGB LED) being driven by Arduino PWM output pins.
// So this code never calls FastLED.addLEDs() or FastLED.show().
//
// This example illustrates one way you can use just the portions
// of FastLED that you need. In this case, this code uses just the
// fast HSV color conversion code.
//
// In this example, the RGB values are output on three separate
// 'analog' PWM pins, one for red, one for green, and one for blue.
#define REDPIN 5
#define GREENPIN 6
#define BLUEPIN 3
This file has been truncated. show original
Can you post your code to paste bin?
joerg_G
(joerg G)
March 3, 2015, 12:21pm
3
Hi Marc!
Thanks a lot for your help.
Yes. Your right. I mean the 4 leg analog led.
Looks like to be that I can use the defined crgb colors like ivory or so to put it out via analog rgb. Thats great. I will make some tests trying to fade in a mixed color, to hold it and fade it out again.
best wishes to you
marmil
(Marc Miller)
March 3, 2015, 4:26pm
4
Super. Looking forward to some animated rgb versions of your art soon.
joerg_G
(joerg G)
March 3, 2015, 4:47pm
5
Here I´m back again.
Some problems appeared.
I wish to drive an analog rgb led (4legs) and fade a special defined color in or from one to another. Perhaps an crgb color to another.
no show like in analog out put-just one or two colors
so how can I change the settings for examlpe in analog output ???
JP_Roy
(JP Roy)
March 3, 2015, 7:53pm
6
Hello @joerg_G ,
Did you run the sketch (program) suggested by Marc Miller ?
joerg_G
(joerg G)
March 3, 2015, 9:06pm
7
yes-works fine-
but it don´t solved my problem
what I wish to do is fade a mixed color with a analog led
if possible the defined crgb colors
fade it in or between two colors - not more
sounds pretty easy
for example CRGB::Olive and fade via analog led (4legs)
JP_Roy
(JP Roy)
March 3, 2015, 9:19pm
8
In the section called void loop()
replace these 2 lines…
showAnalogRGB( CHSV( hue, 255, 255) );
delay(20);
with all these lines…
for (int i=0; i<256; i++){
showAnalogRGB( CHSV( 0, 255, i) );
delay(20);
}
for (int i=255; i>0; i--) {
showAnalogRGB( CHSV( 0, 255, i) );
delay(20);
}
That will slowly fade in and out the color red
change the first value from 0 to anything up to 255 to select another color to fade !!
joerg_G
(joerg G)
March 3, 2015, 9:37pm
9
heureka
that works well
we nearly solved it
I erased the (color bars) at the end of the code and now it works -thank you very much
Ps: is it possible to define the color by keywords?
JP_Roy
(JP Roy)
March 3, 2015, 9:47pm
10
@joerg_G Look into the FastLED documentation…
At the bottom of this link, there is a list of available color names
joerg_G
(joerg G)
March 3, 2015, 10:00pm
11
yes - I got the colornames from the h-file keywords in the 3.1 version of the github page
now I had changed the chsv values against the crgb names and it wors super good
thank you again
you make my day