PaulTurner911 Code

Share you PDE file with our community
User avatar
Posts: 5420
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Mon Jun 23, 2014 10:57 am
Just adding a link to Paul's most recent code, since there's about 15 pages of me and Steve troubleshooting his... lol

viewtopic.php?p=32040#p32040

Posts: 278
Joined: Wed Jan 23, 2013 12:36 pm
PostPosted: Mon Jun 23, 2014 11:18 am
lnevo wrote:Just adding a link to Paul's most recent code, since there's about 15 pages of me and Steve troubleshooting his... lol

viewtopic.php?p=32040#p32040

You SIR are a gentleman and a scholar!!! :)
Just paypal'd Roberto some money for a second jeabo adapter, pumps and harness should arrive soon, patience is a virtue.

Lee, Id like to be in the same boat as Scohen running them antisync and retaining current functionality.

Sorry to beat a dead horse, but could you please run down the duration and speed setup again?!? I think I remember duration in the portal does nothing, but speed has a variance that is defined somewhere hardcoded to make the pump run from 25%-75%. Just dont remember where to define this value and what it should be.

Thank you!!
Image
User avatar
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL
PostPosted: Mon Jun 23, 2014 11:27 am
Maybe Lee can add more to it, or explain it better, but this is what I have in my code of the speed variable.

Code: Select all
ReefAngel.DCPump.Speed=ElseMode(InternalMemory.DCPumpSpeed_read(),20,true );    // ElseMode on sync mode, Portal Speed Setting +/- 20%
User avatar
Posts: 5420
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Mon Jun 23, 2014 11:34 am
Speed is Speed and Duration is Duration. You have nothing in your code that will make anything change versus what's set in the portal. No Variance that I can find. You only had one pump... so would not even mean anything to you initially...

I sent you how to activate the second pump in the anti-sync mode... You just need to define the channel and what it is going to be Sync/Anti-Sync.

Lee

Posts: 278
Joined: Wed Jan 23, 2013 12:36 pm
PostPosted: Mon Jun 23, 2014 12:03 pm
Got it.
You make it sound so simple.
And make me feel like an ass for asking.
There is something that we used to limit the pumps range of power, effectivly stopping the pump from running full power. For whatever reason I thought it had to do with speed and duration.
Image

Posts: 278
Joined: Wed Jan 23, 2013 12:36 pm
PostPosted: Mon Jun 23, 2014 12:11 pm
lnevo wrote:Speed is Speed and Duration is Duration. You have nothing in your code that will make anything change versus what's set in the portal. No Variance that I can find. You only had one pump... so would not even mean anything to you initially...

I sent you how to activate the second pump in the anti-sync mode... You just need to define the channel and what it is going to be Sync/Anti-Sync.

Lee

// Change this to what you want your min/max based on vortech speed
// This is for those functions that take both, but only one memory slot.
int minOffset=25;
int maxOffset=25;

This is what I was thinking....isnt this where you would define the range of the pump (in relation to portal speed)?
PORTAL SPEED=60(currently) +/-25
Pump should run 35-85?
I must not have the correct understanding (not uncommon)
Trying to refresh my noodle.
Last edited by Paulturner911 on Mon Jun 23, 2014 1:48 pm, edited 1 time in total.
Image
User avatar
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL
PostPosted: Mon Jun 23, 2014 12:13 pm
lnevo wrote:Just adding a link to Paul's most recent code, since there's about 15 pages of me and Steve troubleshooting his... lol

viewtopic.php?p=32040#p32040


We never did fix the problem.
I think you said you were going to fix it on the back end.
I can start a new thread for that issue if you want.
User avatar
Posts: 5420
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Mon Jun 23, 2014 3:17 pm
Lol what was the issue that you couldnt set the % on the 2nd pump differently?

Posts: 278
Joined: Wed Jan 23, 2013 12:36 pm
PostPosted: Mon Jun 23, 2014 3:33 pm
Badass! Got everything working, just need the pump!

I also added my skimmer to the feed mode and water change so it power cycles instead of running when its not needed. Added Long Pulse to the random...atleast it didnt give me an error, so I think I did :)

Thanks for the help!
I hadnt touched this stuff in ages, had to do the drivers and software install again since I replaced the HD on my PC. Kinda started to sweat for a min, but it all worked out :)


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

// Feeeding and Water Change mode speed
ReefAngel.DCPump.FeedingSpeed=0;
ReefAngel.DCPump.WaterChangeSpeed=0;


// Ports that are always on

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


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

void loop()
{
ReefAngel.DayLights( Port1 ); // Return Pump
ReefAngel.StandardFan( Port2 ); // Canopy Fans
ReefAngel.ActinicLights( Port3 ); // Actinic LEDS
//Port4 Kalk/ATO
//Port5 Kalk Stir
ReefAngel.DayLights( Port6 );//Port 6 Skimmer
ReefAngel.DayLights( Port7 ); // MH 1
ReefAngel.DayLights( Port8 ); //MH 2
//Moonlight Phase 9pm-10am (CH4-CH5)
if ( (hour() >=10) && (hour() <21) )
ReefAngel.PWM.SetChannel( 4,(0) );
else
ReefAngel.PWM.SetChannel( 4, MoonPhase() );
if ( (hour() >=10) && (hour() <21) )
ReefAngel.PWM.SetChannel( 5,(0) );
else
ReefAngel.PWM.SetChannel( 5, MoonPhase() );

//Over Flow Protection
if (ReefAngel.HighATO.IsActive())
ReefAngel.Relay.On(Port1);
else
ReefAngel.Relay.Off(Port1);

//ATO Protection
if (ReefAngel.LowATO.IsActive())
ReefAngel.Relay.On(Port4);
else
ReefAngel.Relay.Off(Port4);

//Kalk Dose 60sec @ 11pm-12pm (every 15min)
if (hour() >=23 || hour() < 12)
ReefAngel.Relay.Set(Port4, now()%900<60);
else
ReefAngel.Relay.Off(Port4);

//Kalk Stir 12pm-1pm
if (hour() >=12 & hour() < 13)
ReefAngel.Relay.On(Port5);
else
ReefAngel.Relay.Off(Port5);

ReefAngel.DCPump.UseMemory = true;
ReefAngel.DCPump.DaylightChannel = Sync;
ReefAngel.DCPump.ActinicChannel = AntiSync;
////// Place your custom code below here

///// Place your custom code below here

// Add random mode if we set to Mode to Custom in portal
static int rmode;
static boolean changeMode=true;

// These are the modes we can cycle through. You can add more and even repeat...
byte modes[] = { ReefCrest, TidalSwell, ShortPulse, LongPulse, NutrientTransport };

if (now()%SECS_PER_DAY==0 || changeMode==true) { // Change at midnight or if controller rebooted
rmode=random(100)%sizeof(modes); // Change the mode once per day to pick from our array
changeMode=false;
}

// Set timer when in feeding mode
static unsigned long feeding;
if (ReefAngel.DisplayedMenu==FEEDING_MODE) feeding=now();

if (now()-feeding<900) {
  // First 15 minutes after feeding mode stops. Return Pump is off
  ReefAngel.Relay.Off(Port1);
  // First 15 minutes after feeding mode stops. Smart_NTM
  ReefAngel.DCPump.UseMemory=false;
  ReefAngel.DCPump.Mode=NutrientTransport;
} else if (now()-feeding<4500) { // 15 minutes plus 1 hour
  // Continue NTM for the next 60 minutes (75 minutes total)
  ReefAngel.DCPump.UseMemory=false;
  ReefAngel.DCPump.Mode=NutrientTransport;
} else if (now()%SECS_PER_DAY<30600 || now()%SECS_PER_DAY>=81000) { // 8:30am / 10:30pm
  // Night mode (go to 30%)
  ReefAngel.DCPump.UseMemory=false;
  ReefAngel.DCPump.Mode=Constant;
  ReefAngel.DCPump.Speed=30;
} else if (InternalMemory.DCPumpMode_read()==11) {
  // Custom Mode and nothing else going on
  ReefAngel.DCPump.UseMemory=false;
  ReefAngel.DCPump.Mode=modes[rmode];  // Put the mode to the random mode :)
  ReefAngel.DCPump.Speed=InternalMemory.DCPumpSpeed_read(); // Set speed from portal
} else {
  ReefAngel.DCPump.UseMemory=true; // Will reset all values from memory
Image

Posts: 278
Joined: Wed Jan 23, 2013 12:36 pm
PostPosted: Mon Jun 23, 2014 3:46 pm
Right back at it of course...

Added else mode after hacking around with SaCohens code.
Image
PreviousNext

Return to My PDE/INO file

Who is online

Users browsing this forum: No registered users and 3 guests

cron