Do you have a question on how to do something.
Ask in here.
rimai
Posts: 12857 Joined: Fri Mar 18, 2011 6:47 pm
Post
by rimai » Thu Jun 16, 2011 4:16 pm
You could always do it with saltwater and then turn off and just rinse with freshwater at the end.
Easy to do that with RA
Roberto.
alexwbush
Posts: 327 Joined: Tue Mar 22, 2011 12:45 am
Location: San Diego, CA
Post
by alexwbush » Thu Jun 16, 2011 4:44 pm
very true. My concern would be with salt splashing. Most see that already in their sump... nasty stuff.
But, back on topic of programming, I should have LEDs Monday and then let the fun begin!
Roberto, how did you code the PWM expansion for cloud modes? Is it hard coded? Or is there another .h or .cpp file?
alexwbush
Posts: 327 Joined: Tue Mar 22, 2011 12:45 am
Location: San Diego, CA
Post
by alexwbush » Thu Jun 16, 2011 10:24 pm
ok, step 1: random number generator
rimai
Posts: 12857 Joined: Fri Mar 18, 2011 6:47 pm
Post
by rimai » Fri Jun 17, 2011 9:13 am
Roberto.
bmhair03
Posts: 159 Joined: Sun Mar 20, 2011 1:22 pm
Post
by bmhair03 » Thu Jun 23, 2011 8:21 pm
Roberto,
How many drivers do you need to have to run these feature? 6 ?
rimai
Posts: 12857 Joined: Fri Mar 18, 2011 6:47 pm
Post
by rimai » Thu Jun 23, 2011 8:23 pm
You can do storm with just one driver, but you won't get much cloud effect from just 1.
You can achieve a dim down and up, but it won't appear as a passing cloud (to the human eyes).
Roberto.
alexwbush
Posts: 327 Joined: Tue Mar 22, 2011 12:45 am
Location: San Diego, CA
Post
by alexwbush » Thu Jun 23, 2011 8:33 pm
thats one reason I was thinking lightning storm or just cloud cover. Most people have 22 drivers (one blue, one white). But running different drivers for different rows would be pretty cool for effects.
rimai
Posts: 12857 Joined: Fri Mar 18, 2011 6:47 pm
Post
by rimai » Thu Jun 23, 2011 9:42 pm
For those who want to try this with the standard PWM channels, all you have to do is set different values of PWM randomly.
Something like this:
Code: Select all
#include <ReefAngel_Features.h>
#include <ReefAngel_Globals.h>
#include <ReefAngel_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <ReefAngel_EEPROM.h>
#include <ReefAngel_NokiaLCD.h>
#include <ReefAngel_ATO.h>
#include <ReefAngel_Joystick.h>
#include <ReefAngel_LED.h>
#include <ReefAngel_TempSensor.h>
#include <ReefAngel_Relay.h>
#include <ReefAngel_PWM.h>
#include <ReefAngel_Timer.h>
#include <ReefAngel_Memory.h>
#include <ReefAngel.h>
void setup()
{
ReefAngel.Init(); //Initialize controller
randomSeed(analogRead(0));
}
void loop()
{
ReefAngel.ShowInterface();
if (second(now())==0) StandardThunderstorm(); else ReefAngel.PWM.SetDaylight(0);
}
void StandardThunderstorm()
{
byte value=random(255);
ReefAngel.PWM.SetDaylight(value);
}
Roberto.
alexwbush
Posts: 327 Joined: Tue Mar 22, 2011 12:45 am
Location: San Diego, CA
Post
by alexwbush » Fri Jun 24, 2011 12:14 am
sounds good! but doesn't the code above return a value between 0 and 255 for the LED percentage? Shouldn't it be 0-100 or 15-100 for us meanwell driver folks?
For meanwells, maybe something like:
Code: Select all
#include <ReefAngel_Features.h>
#include <ReefAngel_Globals.h>
#include <ReefAngel_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <ReefAngel_EEPROM.h>
#include <ReefAngel_NokiaLCD.h>
#include <ReefAngel_ATO.h>
#include <ReefAngel_Joystick.h>
#include <ReefAngel_LED.h>
#include <ReefAngel_TempSensor.h>
#include <ReefAngel_Relay.h>
#include <ReefAngel_PWM.h>
#include <ReefAngel_Timer.h>
#include <ReefAngel_Memory.h>
#include <ReefAngel.h>
void setup()
{
ReefAngel.Init(); //Initialize controller
randomSeed(analogRead(0));
}
void loop()
{
ReefAngel.ShowInterface();
if (second(now())==0) StandardThunderstorm(); else ReefAngel.PWM.SetDaylight(0);
}
void StandardThunderstorm()
{
//for meanwells 15%-100%
byte value=random(85);
if (value > 0) value = value+15;
ReefAngel.PWM.SetDaylight(value);
}
rimai
Posts: 12857 Joined: Fri Mar 18, 2011 6:47 pm
Post
by rimai » Fri Jun 24, 2011 8:01 am
You got it
Now, go test and make us a video
Roberto.
bmhair03
Posts: 159 Joined: Sun Mar 20, 2011 1:22 pm
Post
by bmhair03 » Fri Jun 24, 2011 8:23 pm
Very nice . will try it tomorrow and film it
bmhair03
Posts: 159 Joined: Sun Mar 20, 2011 1:22 pm
Post
by bmhair03 » Fri Jun 24, 2011 8:33 pm
if i wanted to try the cloud since i have 2 drivers what is the code for that . Now i might even break my 24 LEDS into 3 strand and add a third driver . Roberto can u PM me availability of the PWM expansion. And is it possible to mod Gen 1 boxes to work with it.
rimai
Posts: 12857 Joined: Fri Mar 18, 2011 6:47 pm
Post
by rimai » Fri Jun 24, 2011 8:54 pm
Although it is possible to mod it, you would have to send it to me. It's not as simple.
Roberto.
bmhair03
Posts: 159 Joined: Sun Mar 20, 2011 1:22 pm
Post
by bmhair03 » Sat Jun 25, 2011 4:12 pm
I have the code uploaded .What are the item that I put values in .Just the random (85) spot and what dose the % represent. will this just control 1 channel or both.
bmhair03
Posts: 159 Joined: Sun Mar 20, 2011 1:22 pm
Post
by bmhair03 » Sat Jun 25, 2011 4:41 pm
When i add the above code All that happens is my daylights start pulsing rapidly
rimai
Posts: 12857 Joined: Fri Mar 18, 2011 6:47 pm
Post
by rimai » Sat Jun 25, 2011 5:14 pm
It should pulse for just one second though.
The code will pulse everytime you have a whole minute for 1 second.
I'm curious to see a video. Can you create one?
Roberto.
bmhair03
Posts: 159 Joined: Sun Mar 20, 2011 1:22 pm
Post
by bmhair03 » Sat Jun 25, 2011 9:14 pm
yes i can make a video. It didnt stop for me just kept strobing .
rimai
Posts: 12857 Joined: Fri Mar 18, 2011 6:47 pm
Post
by rimai » Sat Jun 25, 2011 10:02 pm
Let me test it then.
Roberto.
bmhair03
Posts: 159 Joined: Sun Mar 20, 2011 1:22 pm
Post
by bmhair03 » Sun Jun 26, 2011 4:29 pm
sounds go you know what your doing unlike me.
rimai
Posts: 12857 Joined: Fri Mar 18, 2011 6:47 pm
Post
by rimai » Sun Jun 26, 2011 4:42 pm
I think it's got to do with the following line:
Code: Select all
ReefAngel.PWM.SetDaylight(PWMSlope(10,30,19,30,15,65,60,ReefAngel.PWM.GetDaylightValue()));
Try removing it.
I'll only be able to test tomorrow. I have LED string to test at the office.
Roberto.
binder
Posts: 2865 Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:
Post
by binder » Sun Jun 26, 2011 4:52 pm
rimai wrote: I think it's got to do with the following line:
Code: Select all
ReefAngel.PWM.SetDaylight(PWMSlope(10,30,19,30,15,65,60,ReefAngel.PWM.GetDaylightValue()));
Try removing it.
I'll only be able to test tomorrow. I have LED string to test at the office.
I would think that having the PWMSlope function in use would affect the PWM output with the selection of the Cloud cover or Thunderstorm since it continually sets the PWM values.
curt
bmhair03
Posts: 159 Joined: Sun Mar 20, 2011 1:22 pm
Post
by bmhair03 » Sun Jun 26, 2011 5:23 pm
Got it working by commenting out a redondit line. Stays in storm mode dosen't reset to the before PWM values. Will post the video when I figure out how.
Last edited by
bmhair03 on Sun Jun 26, 2011 7:51 pm, edited 1 time in total.
rimai
Posts: 12857 Joined: Fri Mar 18, 2011 6:47 pm
Post
by rimai » Sun Jun 26, 2011 5:26 pm
Cool.
Does it look good?
Roberto.
bmhair03
Posts: 159 Joined: Sun Mar 20, 2011 1:22 pm
Post
by bmhair03 » Sun Jun 26, 2011 7:50 pm
Yes it looks really nice. still working on the upload.
bmhair03
Posts: 159 Joined: Sun Mar 20, 2011 1:22 pm
Post
by bmhair03 » Mon Jun 27, 2011 9:28 am
Is it possible to make the lighting faster or sharper? Or is that the drivers
rimai
Posts: 12857 Joined: Fri Mar 18, 2011 6:47 pm
Post
by rimai » Mon Jun 27, 2011 9:40 am
Nice.
Agreed. Needs more contrast between between peeks.
Let me work on it.
Roberto.
bmhair03
Posts: 159 Joined: Sun Mar 20, 2011 1:22 pm
Post
by bmhair03 » Mon Jun 27, 2011 11:27 am
You the Man Roberto! Thanks for the help.
rimai
Posts: 12857 Joined: Fri Mar 18, 2011 6:47 pm
Post
by rimai » Mon Jun 27, 2011 12:09 pm
I changed to this:
Code: Select all
void StandardThunderstorm()
{
byte value=random(100);
if (value>60) ReefAngel.PWM.SetDaylight(50); else ReefAngel.PWM.SetDaylight(0);
}
It looks much better
To make it trigger faster than every whole minute, use this instead:
Code: Select all
if ((second(now())%10)<=3) StandardThunderstorm(); else ReefAngel.PWM.SetDaylight(0);
This code will actually make it last 3s every 10s, so you can have see the effect faster.
3s duration seems to give better result than just 1 second.
Roberto.