actinic moonlight

Do you have a question on how to do something.
Ask in here.
Post Reply
thoughtiknew
Posts: 28
Joined: Mon Jan 20, 2014 7:41 pm

actinic moonlight

Post by thoughtiknew »

i want my actinic channel (which is on dim expansion 0)to dim down and then stop at a low point and stay at that level and begin lunar simulation
i am a fair coder and am familiar arduino but i am just getting started with reef angel in fact my reef angel is not even here yet :D just pre configuring some stuff in advance.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: actinic moonlight

Post by rimai »

Try this:

Code: Select all

ReefAngel.PWM.SetChannel(0,PWMSlope(9,0,19,0,0,100,60,MoonPhase());
Roberto.
thoughtiknew
Posts: 28
Joined: Mon Jan 20, 2014 7:41 pm

Re: actinic moonlight

Post by thoughtiknew »

where is the moonphase function located so i can review its usage

thanks in advance
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: actinic moonlight

Post by rimai »

Globals.cpp
Roberto.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: actinic moonlight

Post by Sacohen »

Following along. Sounds like something I might want to do when I get my LED's set up.
thoughtiknew
Posts: 28
Joined: Mon Jan 20, 2014 7:41 pm

Re: actinic moonlight

Post by thoughtiknew »

Ok now I have the controller up and running but after three code revisions I now have decided to switch to internal memory wondering how I might accomplish this in that case
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: actinic moonlight

Post by lnevo »

Go on the portal and under internal memory, go through all the settings and configure what you want/need.

Run the wizard again and choose internal memory path..
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: actinic moonlight

Post by lnevo »

Compare that to what you have if you've already customized it so you can see how the functions work when using memory
thoughtiknew
Posts: 28
Joined: Mon Jan 20, 2014 7:41 pm

Re: actinic moonlight

Post by thoughtiknew »

I have already successfully changed everything but the moonlights over too the internal memory essentially I need to know how to code the moon phase function to work on my actinic channel thinking about jumping out the channel 0 and 2 then I can just run moon phase on channel 2. But I would also like to be able to have the actinic channel shutoff at a given time or a given number of hours after the lights off time providing for say 4 hours of simulated moon light and then allowing a period of no light for the tank

Furthermore for anyone that would like to set their moonlights to a maximum percentage of the dimming cycle see the code below...It would be nice if the MoonMax Value could have a internal memory location so it could be changed from the portal but havn't figured that out yet

int MoonMax = 25;


ReefAngel.PWM.SetChannel( 2, (MoonPhase()/(100/MoonMax)) );
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: actinic moonlight

Post by rimai »

I'm not understanding what you are trying to do.
You mentioned 3 channels: Actinic, Channel 0 and Channel 2.
Which one is that you have the moonlights connected to and what are the other channels mentioned for?
Roberto.
thoughtiknew
Posts: 28
Joined: Mon Jan 20, 2014 7:41 pm

Re: actinic moonlight

Post by thoughtiknew »

Dim expansion 0 is my actinic channel
Dim expansion 1 is my daylight channel
Dim expansion 2 is my sudo moonlight channel which I created by placing a jumper from channel 2 to channel 0 ( jumpet not actually in place just theoretical at this point)
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: actinic moonlight

Post by rimai »

I'm still not getting it.
What is this jumper you are talking about?? A physical jumper?
What do you want to do with each channel?
Roberto.
thoughtiknew
Posts: 28
Joined: Mon Jan 20, 2014 7:41 pm

Re: actinic moonlight

Post by thoughtiknew »

Yes a physical jumper

The goal is this I want to use my actinic channel of my leds to also simulate the moon phase during the dark hours so my logic is this my actinic Chanel dims to zero sometime around 9pm at which point the moonphase function will kick in on channel 2 which is also connected to my actinic lights however instead of the moon phase returning a value between 0 and 100 I want it to return a value between 0 and moonmax.... I have all of this working in the code already only part I still need to get working is I would like my actinic channel to shut off completely 4 hours after the lights out time actinic is on port 8
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: actinic moonlight

Post by rimai »

Don't do a physical jumper.
Looks so awful solution when you can do it easily with software.
I think this is what you want to do:

Code: Select all

ReefAngel.PWM.SetChannel(0,PWMSlope(9,0,21,0,0,100,60, (MoonPhase()/(100/MoonMax)) );
if (hour()>=1 && hour()<9) ReefAngel.PWM.SetChannel(0,0);
Roberto.
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: actinic moonlight

Post by lnevo »

+1
thoughtiknew
Posts: 28
Joined: Mon Jan 20, 2014 7:41 pm

Re: actinic moonlight

Post by thoughtiknew »

I had it like that at first however I am storing my values in the internal memory .... Not sure how I can accomplish it given that


Also Setting the pwm to zero doesn't shut my lights off something weird in the driver I need to shut the port off ...port 7

Is there a way I can create my own internal memory locations and how do I reference them
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: actinic moonlight

Post by rimai »

Use something like this:

Code: Select all

MoonMax=InternalMemory.read(100);
Then, you can save the value in memory location 100 like this:

Code: Select all

InternalMemory.write(100,25);
Roberto.
thoughtiknew
Posts: 28
Joined: Mon Jan 20, 2014 7:41 pm

Re: actinic moonlight

Post by thoughtiknew »

So I had a little extra time tonight and got to digging in the code ended up writing my own class adding some internal memory defines so now all I need is a call to the class and then write a value to position 364 and I am all set. Tomorrow I will clean it up and add some more comments and post it here for everyone


Last question is there a block of memory addresses that is reserved from further development?
Post Reply