troylong45 ino

Share you PDE file with our community
User avatar
Posts: 5365
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Sat Sep 10, 2016 1:35 pm
Whats the compile errors

Posts: 214
Joined: Sat Oct 10, 2015 9:17 pm
PostPosted: Sat Sep 10, 2016 2:50 pm
O... the code is already in the ino thats y is wouldnt lol . now that i relize the code was there already i changed the delayport to the delayedon

now on reboot it dont delay which is 2 of 3 things working the delay on feed,no delay on reboot. now need to stop delay on water change mode

this in my loop
Code: Select all
DelayedOnFeedMode(Return); // DelayedOn after feed mode change only


this is at the end of my controller display setting and befor storm code
Code: Select all
void DelayedOnFeedMode(byte relay) {
  static unsigned long startTime=now();

  if ( (startTime==LastStart) && ReefAngel.HighATO.IsActive()) {
    ReefAngel.Relay.On(relay);
  } else {
    ReefAngel.Relay.DelayedOn(relay);
  }
}
Image
User avatar
Posts: 5365
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Sat Sep 10, 2016 3:56 pm
Code: Select all
if ( (startTime==LastStart || ReefAngel.DisplayedMenu==WATERCHANGE_MODE) && ReefAngel.HighATO.IsActive()) {
    ReefAngel.Relay.On(relay);
  } else {
    ReefAngel.Relay.DelayedOn(relay);
  }

Posts: 214
Joined: Sat Oct 10, 2015 9:17 pm
PostPosted: Sat Sep 10, 2016 4:23 pm
ok also i was wondering what the meaning of high ato. i was trying to search for this info and i seen it was for a skimmer like your code is but since its for my return i guess i dont need high ato in there ? and last time was for power outage ?
Image
User avatar
Posts: 5365
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Sat Sep 10, 2016 7:11 pm
I dont want my skimmer running when the water level is to high. I wrote this so if the ra rebooted it wasn't off for 10 minutes

Posts: 214
Joined: Sat Oct 10, 2015 9:17 pm
PostPosted: Sun Sep 11, 2016 1:54 am
its working ... thanks again . i also replaced virtual switch 4to1 led to turn storm on or off instead of memory and added all the storm variables in memory to edit so well see how it all goes during day light
Code: Select all
#define Mem_B_CloudsEveryXDays    149
        #define Mem_B_CloudChancePerDay   150
        #define Mem_B_MinCloudDuration    151
        #define Mem_B_MaxCloudDuration    152
        #define Mem_B_MinCloudsPerDay     153
        #define Mem_B_MaxCloudsPerDay     154
        #define Mem_B_StartCloudAfterHour 155
        #define Mem_B_StartCloudAfterMin  156
        #define Mem_B_EndCloudBeforeHour  157
        #define Mem_B_EndCloudBeforeMin   158
        #define Mem_B_LightningChance     159

Code: Select all
InternalMemory.write(Mem_B_CloudsEveryXDays,1);      //mb149
          InternalMemory.write(Mem_B_CloudChancePerDay,50);    //mb150
          InternalMemory.write(Mem_B_MinCloudDuration,6);      //mb151
          InternalMemory.write(Mem_B_MaxCloudDuration,10);     //mb152
          InternalMemory.write(Mem_B_MinCloudsPerDay,2);       //mb153
          InternalMemory.write(Mem_B_MaxCloudsPerDay,8);       //mb154
          InternalMemory.write(Mem_B_StartCloudAfterHour,10);  //mb155
          InternalMemory.write(Mem_B_StartCloudAfterMin,00);   //mb156
          InternalMemory.write(Mem_B_EndCloudBeforeHour,22);   //mb157
          InternalMemory.write(Mem_B_EndCloudBeforeMin,00);    //mb158
          InternalMemory.write(Mem_B_LightningChance,50);      //mb159

Code: Select all
// ------------------------------------------------------------
// Change the values below to customize your cloud/storm effect

// Frequency in days based on the day of the month - number 2 means every 2 days, for example (day 2,4,6 etc)
// For testing purposes, you can use 1 and cause the cloud to occur everyday
#define Clouds_Every_X_Days InternalMemory.read(Mem_B_CloudsEveryXDays)

// Percentage chance of a cloud happening today
// For testing purposes, you can use 100 and cause the cloud to have 100% chance of happening
#define Cloud_Chance_per_Day InternalMemory.read(Mem_B_CloudChancePerDay)

// Minimum number of minutes for cloud duration.  Don't use min duration of less than 6
#define Min_Cloud_Duration InternalMemory.read(Mem_B_MinCloudDuration)

// Maximum number of minutes for the cloud duration. Don't use max duration of more than 255
#define Max_Cloud_Duration InternalMemory.read(Mem_B_MaxCloudDuration)

// Minimum number of clouds that can happen per day
#define Min_Clouds_per_Day InternalMemory.read(Mem_B_MinCloudsPerDay)

// Maximum number of clouds that can happen per day
#define Max_Clouds_per_Day InternalMemory.read(Mem_B_MaxCloudsPerDay)

// Only start the cloud effect after this setting
// In this example, start cloud after noon
#define Start_Cloud_After NumMins(InternalMemory.read(Mem_B_StartCloudAfterHour),InternalMemory.read(Mem_B_StartCloudAfterMin))

// Always end the cloud effect before this setting
// In this example, end cloud before 9:00pm
#define End_Cloud_Before NumMins(InternalMemory.read(Mem_B_EndCloudBeforeHour),InternalMemory.read(Mem_B_EndCloudBeforeMin))

// Percentage chance of a lightning happen for every cloud
// For testing purposes, you can use 100 and cause the lightning to have 100% chance of happening
#define Lightning_Chance_per_Cloud InternalMemory.read(Mem_B_LightningChance)


changed all LED_STORM to TRIGGER_STORM and added new LED_STORM for enable mode
Code: Select all
        #define Mem_B_EnableStorm         178

Code: Select all
#define LED_1to1      Box2_Port1
#define LED_2to1      Box2_Port2
#define LED_3to1      Box2_Port3
#define LED_BLUE      Box2_Port4
#define LED_WHITE     Box2_Port5
#define LED_MOON      Box2_Port6
#define LED_STORM     Box2_Port7
#define TRIGGER_STORM Box2_Port8

Code: Select all
// Now that we have all the parameters for the cloud, let's create the effect

 if (ReefAngel.Relay.isMaskOn(LED_STORM)) {
    InternalMemory.write(Mem_B_EnableStorm,false);
  }
  if (ReefAngel.Relay.isMaskOff(LED_STORM)) {
    InternalMemory.write(Mem_B_EnableStorm,true);
  }

  if (InternalMemory.read(Mem_B_EnableStorm)) return;
 
 
  if (cloudchance)
  {
    if (ReefAngel.Relay.isMaskOff(TRIGGER_STORM))      // Change this to whatever port you want to use as a trigger.
    {
      cloudstart = NumMins(hour(), minute());
      ReefAngel.Relay.Auto(TRIGGER_STORM);    // Here, too.
    }

Code: Select all
// Cloud ON option - Clouds every minute
  if (ReefAngel.Relay.isMaskOn(TRIGGER_STORM) && now()%60<10)
  {
    SlowStrike();
  }
Image

Posts: 214
Joined: Sat Oct 10, 2015 9:17 pm
PostPosted: Tue Nov 15, 2016 10:44 am
Can help me again with my code again i dont know why the wave makers arenot doing lunar/tide part any more for few months it hasent
And the storm will turn off the lights during lightning at times idk if it is dimming tolow or above range is there away to give it a number it cant go past so they dont turn offat times
Image
Previous

Return to My PDE/INO file

Who is online

Users browsing this forum: No registered users and 2 guests

cron