Re: troylong45 ino
Posted: Sat Sep 10, 2016 1:35 pm
Whats the compile errors
Community discussion about Reef Angel Controllers and reefing related subjects
http://forum.reefangel.com/
Code: Select all
DelayedOnFeedMode(Return); // DelayedOn after feed mode change only
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);
}
}
Code: Select all
if ( (startTime==LastStart || ReefAngel.DisplayedMenu==WATERCHANGE_MODE) && ReefAngel.HighATO.IsActive()) {
ReefAngel.Relay.On(relay);
} else {
ReefAngel.Relay.DelayedOn(relay);
}
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)
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();
}