- Location
- Queens
First I want to say two things:
I have practically no experience coding. Please bear with me.
I really really appreciate you for reading this very long post and helping me.
The project:
I want to use an analog RGB 5050 LED strip to simulate a sunrise, daytime, sunset and nighttime lighting atmosphere in my fish tank.
I will wire it to the PWM ports on the following Arduino controller:
http://www.amazon.com/SainSmart-ATme...nsmart+arduino
The wiring schematic is as described on this site:
http://learn.adafruit.com/rgb-led-strips/overview
I plan to use the VaRGB library and take advantage of the linear and constant transition curves
http://flyingcarsandstuff.com/projects/vargb/
In the VaRGB guide it mentions using a callback to communicate with the RGB strip.
http://flyingcarsandstuff.com/projec...gramming-vargb
I'm not sure how to get this callback done.
I also plan to use an RTC module such as this:
http://www.amazon.com/SainSmart-DS13...=arduino+clock
or
http://www.amazon.com/SainSmart-DS13...ds=arduino+RTC
How do I integrate this RTC module electrically to the Arduino and also through the code so I can program my VaRGB linear/constant curves based on time.
I'd like to program various curves to run simultaneously for very smooth fading and transition. But I can also run the curves sequentially as I've outlined below.
Basically the color transition would be:
Sunset (opposite for Sunrise)
Start at the end of the constant white curve.
The lights change to a bright yellowish white, then a medium brightness orange, to a dark red, to a twilight blue down to very dim dark blue as a moonlight.
In the morning the RGB spectrum would be (on a 0-256 scale)
Red 0, Green 0, Blue 10 (Moonlight)
I would ramp up to Red 20, Green 0, Blue 10. (Dark Red)
Then I would ramp to Red 30, Green 0, Blue 10. (Medium Red)
Next would be Red 40, Green 30, Blue 15 (Medium Orange)
After that would be Red 50, Green 50, Blue 20 (Yellow)
And from this I would ramp to Red 100, Green 100, Blue 100 (White)
I will be playing around with these colors. This is just an example
I don't know how to do the callback but this is what is on the site:
void MyColorSettingCallback (vargb::ColorSettings * color_values) {
the_brite.sendColor(color_values->red, color_values->green,
color_values->blue);
}
This is assuming I use the TinyBrite library. Would I just remove the "the_brite"?
I don't know what library I would be using.
After setting up the callback you set up the driver like this:
vargb::VaRGB vargb_driver(MyColorSettingCallback);
Also, how would I set the threshold for the PWM on the VaRGB?
i.e. 0-256?
On the VaRGB website they use numbers past 256.
I know this so far:
For the VaRGB coding I would do:
Constant(0,0,0,3600)
Linear(0,0,50,3600)
This would fade blue to 50 from 0 in the duration of one hour.
I would set a line like this for each transition.
Then I would add all the transitions to a schedule:
vargb::Schedule my_schedule;
my_schedule.addTransition(&some_linear_curve);
my_schedule.addTransition(&another_constant_curve);
my_schedule.addTransition(a_pointer_to_the_final_linear_curve);
Then I could set the desired schedule into the driver as:
my_driver.setSchedule(&my_schedule);
I have practically no experience coding. Please bear with me.
I really really appreciate you for reading this very long post and helping me.
The project:
I want to use an analog RGB 5050 LED strip to simulate a sunrise, daytime, sunset and nighttime lighting atmosphere in my fish tank.
I will wire it to the PWM ports on the following Arduino controller:
http://www.amazon.com/SainSmart-ATme...nsmart+arduino
The wiring schematic is as described on this site:
http://learn.adafruit.com/rgb-led-strips/overview
I plan to use the VaRGB library and take advantage of the linear and constant transition curves
http://flyingcarsandstuff.com/projects/vargb/
In the VaRGB guide it mentions using a callback to communicate with the RGB strip.
http://flyingcarsandstuff.com/projec...gramming-vargb
I'm not sure how to get this callback done.
I also plan to use an RTC module such as this:
http://www.amazon.com/SainSmart-DS13...=arduino+clock
or
http://www.amazon.com/SainSmart-DS13...ds=arduino+RTC
How do I integrate this RTC module electrically to the Arduino and also through the code so I can program my VaRGB linear/constant curves based on time.
I'd like to program various curves to run simultaneously for very smooth fading and transition. But I can also run the curves sequentially as I've outlined below.
Basically the color transition would be:
Sunset (opposite for Sunrise)
Start at the end of the constant white curve.
The lights change to a bright yellowish white, then a medium brightness orange, to a dark red, to a twilight blue down to very dim dark blue as a moonlight.
In the morning the RGB spectrum would be (on a 0-256 scale)
Red 0, Green 0, Blue 10 (Moonlight)
I would ramp up to Red 20, Green 0, Blue 10. (Dark Red)
Then I would ramp to Red 30, Green 0, Blue 10. (Medium Red)
Next would be Red 40, Green 30, Blue 15 (Medium Orange)
After that would be Red 50, Green 50, Blue 20 (Yellow)
And from this I would ramp to Red 100, Green 100, Blue 100 (White)
I will be playing around with these colors. This is just an example
I don't know how to do the callback but this is what is on the site:
void MyColorSettingCallback (vargb::ColorSettings * color_values) {
the_brite.sendColor(color_values->red, color_values->green,
color_values->blue);
}
This is assuming I use the TinyBrite library. Would I just remove the "the_brite"?
I don't know what library I would be using.
After setting up the callback you set up the driver like this:
vargb::VaRGB vargb_driver(MyColorSettingCallback);
Also, how would I set the threshold for the PWM on the VaRGB?
i.e. 0-256?
On the VaRGB website they use numbers past 256.
I know this so far:
For the VaRGB coding I would do:
Constant(0,0,0,3600)
Linear(0,0,50,3600)
This would fade blue to 50 from 0 in the duration of one hour.
I would set a line like this for each transition.
Then I would add all the transitions to a schedule:
vargb::Schedule my_schedule;
my_schedule.addTransition(&some_linear_curve);
my_schedule.addTransition(&another_constant_curve);
my_schedule.addTransition(a_pointer_to_the_final_linear_curve);
Then I could set the desired schedule into the driver as:
my_driver.setSchedule(&my_schedule);