Moon Cycle

Do you have a question on how to do something.
Ask in here.
Post Reply
Johan65
Posts: 4
Joined: Wed Mar 28, 2012 10:01 am

Moon Cycle

Post by Johan65 »

I need some Help with my Mooncycle,

Code: Select all

ReefAngel.PWM.ActinicPWMSlope();
      MoonPWMValue=MoonPhase();
  if (hour()==22 || hour()==7)
     MoonPWMValue=PWMSlope(22,00,7,00,2,MoonPhase(),60,2);
  if (ReefAngel.Relay.Status(Port8)) MoonPWMValue=0;

ReefAngel.LCD.DrawLargeText(COLOR_GRAY, COLOR_WHITE,25,110, "MOON"); 
if (ReefAngel.PWM.GetActinicValue() ==0) ReefAngel.LCD.DrawLargeText(COLOR_BLUE, COLOR_WHITE,65,110,"OFF");
else if(ReefAngel.PWM.GetActinicValue() >=1 && ReefAngel.PWM.GetActinicValue() < 20) ReefAngel.LCD.DrawLargeText(COLOR_GREEN, COLOR_WHITE,65,110,"NEW");
else if(ReefAngel.PWM.GetActinicValue() >=20 && ReefAngel.PWM.GetActinicValue() < 30) ReefAngel.LCD.DrawLargeText(COLOR_YELLOW, COLOR_WHITE,65,110,"CRESENT");
else if(ReefAngel.PWM.GetActinicValue() >=30 && ReefAngel.PWM.GetActinicValue() < 40) ReefAngel.LCD.DrawLargeText(COLOR_RED, COLOR_WHITE,65,110,"HALF");
else if(ReefAngel.PWM.GetActinicValue() >=40 && ReefAngel.PWM.GetActinicValue() < 50) ReefAngel.LCD.DrawLargeText(COLOR_PURPLE, COLOR_WHITE,65,110,"GIBBOUS");
else if(ReefAngel.PWM.GetActinicValue() >=50 && ReefAngel.PWM.GetActinicValue() < 60) ReefAngel.LCD.DrawLargeText(COLOR_ORANGE, COLOR_WHITE,65,110,"FULL");
It does swich on at 22:00 but it stays at NEW,

Any input?
Johan
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Moon Cycle

Post by rimai »

I think it is because we are on the new moon.
Roberto.
Johan65
Posts: 4
Joined: Wed Mar 28, 2012 10:01 am

Re: Moon Cycle

Post by Johan65 »

Hmm, But I am sure that this cycle is supposed to change about every 1 1/2 hours?
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Moon Cycle

Post by rimai »

Roberto.
Johan65
Posts: 4
Joined: Wed Mar 28, 2012 10:01 am

Re: Moon Cycle

Post by Johan65 »

ok, I understand that it only changes little per day, but does this code work like that,

I thought that this will be 2%-60%-2% in every night(22-7), according to what I reed in the programming

but if it works like the link you gave me, very cool
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Moon Cycle

Post by rimai »

PWMSlope(22,00,7,00,2,MoonPhase(),60,2);
This means it starts at 2% grows to whatever the moon cycle is for today within 60 minutes.
Same thing but opposite way for the other end of the cycle.
The last 2 means it will output 2% whenever is not time to ramp up or down.
http://forum.reefangel.com/viewtopic.php?f=12&t=16
Roberto.
Johan65
Posts: 4
Joined: Wed Mar 28, 2012 10:01 am

Re: Moon Cycle

Post by Johan65 »

Cool, thank you very much
Post Reply