PWM Readings

New members questions
Post Reply
Paulturner911
Posts: 288
Joined: Wed Jan 23, 2013 12:36 pm

PWM Readings

Post by Paulturner911 »

Tonights moon is 62%. My channels read actinic 42% daylight 20%. I'm only using one port currently. I get that it adds up to 62, why doesn't it just have 62% on my actinic side? Also I'm not sure, but does the moonlight kit run all day? It seems to be illuminated every time I see it. Thanks guys.... Between Roberto and Lee I'm pretty sure I could take on the world with the help they provide!
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

PWM Readings

Post by lnevo »

My moonphase is at 42% on mine tonight... Not sure where the 20% is coming from.

It will be on all day unless you put an if statement around the SetActinic function that sets the percentage so it's only on when you want them on..
Paulturner911
Posts: 288
Joined: Wed Jan 23, 2013 12:36 pm

Re: PWM Readings

Post by Paulturner911 »

I kind of thought they stayed on all of the time...no biggie really, I can live with that. I just find it odd that my PWM readings show Actinic 42% and daylight 20%, while Im not using the daylight port. I did originally have both ports set to moon phase since I wasnt sure which one I had it plugged into. Maybe that could have something to do with it? I have since deleted that line of code. Does yours read 20% also on the daylight port? When I googled the moonphase it said 62 tonight. I would think the port set on moonphase would read that!??!
Thanks again for the code on the ATO/Kalk doser...Ill graph my ph swing tomorrow while at work to see if it improves. Its not too rough right now, but every bit helps. The probe seems a little choppy, as it never stays on the hundredth very long (8.15-8.16-8.15), maybe I should calibrate it again a bit longer on both 7 and 10?
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

PWM Readings

Post by lnevo »

Mine are both set to moonphase so i dont have that issue. Try adding SetDaylight(0);

The code to have them on only when you want is not hard...you have them template from your kalk function...

Try out the syntax here and we can help you tweak it...
Paulturner911
Posts: 288
Joined: Wed Jan 23, 2013 12:36 pm

Re: PWM Readings

Post by Paulturner911 »

Anything like this? Id like them to come on at 9pm and off at 10am.
I also see codes with // infront does that make a "comment" with in your code so you konw what functions are with out affecting the code?

if ( (hour() >=10) && (hour() <21) )
ReefAngel.PWM.SetActinic(0);
else
ReefAngel.PWM.SetActinic(moonphase);


Bear with me guys. Still very much a noob!
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: PWM Readings

Post by rimai »

Good job :)
Just one typo though...
moonphase needs to be MoonPhase()
Roberto.
Paulturner911
Posts: 288
Joined: Wed Jan 23, 2013 12:36 pm

Re: PWM Readings

Post by Paulturner911 »

I see....

if ( (hour() >=10) && (hour() <21) )
ReefAngel.PWM.SetActinic(0);
else
ReefAngel.PWM.SetActinic(MoonPhase() );
????

Can I put \\ before anything within my code like....

\\Moonlight 9-10
if ( (hour() >=10) && (hour() <21) )
ReefAngel.PWM.SetActinic(0);
else
ReefAngel.PWM.SetActinic(MoonPhase);
???
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: PWM Readings

Post by rimai »

Yes... Anything after \\ in the same line is considered comments and won't do anything.
Roberto.
Paulturner911
Posts: 288
Joined: Wed Jan 23, 2013 12:36 pm

Re: PWM Readings

Post by Paulturner911 »

Awesome! Does this check out in your book?
#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_NokiaLCD.h>
#include <RA_ATO.h>
#include <RA_Joystick.h>
#include <LED.h>
#include <RA_TempSensor.h>
#include <Relay.h>
#include <RA_PWM.h>
#include <Timer.h>
#include <Memory.h>
#include <InternalEEPROM.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <Salinity.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <PH.h>
#include <WaterLevel.h>
#include <ReefAngel.h>

////// Place global variable code below here


////// Place global variable code above here


void setup()
{
// This must be the first line
ReefAngel.Init(); //Initialize controller
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = Port1Bit | Port2Bit | Port5Bit | Port6Bit | Port7Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port2Bit | Port3Bit | Port5Bit | Port6Bit | Port8Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port3Bit | Port5Bit | Port6Bit | Port8Bit;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 869 );


// Ports that are always on

////// Place additional initialization code below here


////// Place additional initialization code above here
}

void loop()
{
\\Pump Delay 15min
ReefAngel.Relay.DelayedOn( Port1,15 );
\\Actinic 10am-10am
ReefAngel.StandardLights( Port3,10,0,22,0 );
\\MH 12pm-7pm
ReefAngel.StandardLights( Port5,12,0,19,0 );
ReefAngel.StandardLights( Port6,12,0,19,0 );
\\Powerhead Delay 1min
ReefAngel.Relay.DelayedOn( Port7,1 );
\\Frag 10pm-10am
ReefAngel.StandardLights( Port8,22,0,10,0 );
\\PWM Daylight off
ReefAngel.PWM.SetDaylight(0) );
\\Fan on over 80
ReefAngel.StandardFan(Port2,790,800);
\\Overflow Protection
ReefAngel.Relay.Set(Port1,ReefAngel.HighATO.IsActive());
\\Moonlight Phase 9pm-10am
if ( (hour() >=10) && (hour() <21) )
ReefAngel.PWM.SetActinic(0);
else
ReefAngel.PWM.SetActinic(MoonPhase() );
if ( (hour() >=2) && (hour() <10) )
\\Kalk Dose 1min @ 2am-10am (every 30min)
ReefAngel.Relay.Set(Port4, now()%1800<60);
else
ReefAngel.Relay.Off(Port4);
////// Place your custom code below here


////// Place your custom code above here

// This should always be the last line
ReefAngel.Portal( "paulturner911" );
ReefAngel.ShowInterface();
}


Thanks a bunch guys. I dont want to say Im getting it, but Im surely fumbling my way through it! :)
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

PWM Readings

Post by lnevo »

Your comment slashes are backwards...although who knows they may work...the normal comment is //

You can also comment multiple lines or blocks if code with

/*
Comments in here..
*/

Good luck you are on your way!!!
Paulturner911
Posts: 288
Joined: Wed Jan 23, 2013 12:36 pm

Re: PWM Readings

Post by Paulturner911 »

The slashes would NOT work, I got an error during verifying.
I also had an error in my PWM daylight
ReefAngel.PWM.SetDaylight(0) );
should have been
ReefAngel.PWM.SetDaylight(0) ;

But I got through it!!
Before I uploaded it I was going to ask if there is anything simple for screen change or custom menu I should do? I havent read much into them but Im going to start.... :)
Thanks guys, I gotta crawl before I can walk
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

PWM Readings

Post by lnevo »

Menus are a little tricky...there's an app to help generate menus though...
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: PWM Readings

Post by binder »

Paulturner911
Posts: 288
Joined: Wed Jan 23, 2013 12:36 pm

Re: PWM Readings

Post by Paulturner911 »

Thanks, Im gonna pass on that right now :)
Image
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: PWM Readings

Post by binder »

Paulturner911 wrote:Thanks, Im gonna pass on that right now :)
you can at least look at it to understand more. depending on what you customize with the menu, you can reduce the size of your code.
Paulturner911
Posts: 288
Joined: Wed Jan 23, 2013 12:36 pm

Re: PWM Readings

Post by Paulturner911 »

Why does my moon phase never match what this says??
http://www.calendar-365.com/moon/curren ... phase.html
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: PWM Readings

Post by rimai »

Roberto.
Paulturner911
Posts: 288
Joined: Wed Jan 23, 2013 12:36 pm

Re: PWM Readings

Post by Paulturner911 »

Thanks! I just got my NEW order for you guys!! Still waiting on my WP40...
Any idea when the new libs gonna be released?
Im thinking I can knock it all out at once (never the case) and get the PWM installed, WP coded and the second moonlight hooked up with the updated libs.

I also read in the PWM manual that there were jumpers that needed to be installed inside the RA? Is this still the case? I didnt see any in my shipment.
Image
Post Reply