lnevo
I've tried to add this to my nighttime mode but am getting some errors....here is the error msg:
My_RA_Version2_1.cpp: In function 'void loop()':
My_RA_Version2_1:253: error: expected primary-expression before '.' token
My_RA_Version2_1:253: error: '2' cannot be used as a function
And this is the code in the loop:
// Jebao Code
// Feeeding and Water Change mode speed
ReefAngel.DCPump.FeedingSpeed=0;
ReefAngel.DCPump.WaterChangeSpeed=0;
pinMode(lowATOPin,OUTPUT);
analogWrite(lowATOPin,ReefCrestMode(50,20,true)*2.55);
ReefAngel.DCPump.UseMemory = true;
ReefAngel.DCPump.LowATOChannel = Sync ; // Jebo connected to AtoPINLow
// 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[] = { Lagoon, ReefCrest, TidalSwell, Sine, Gyre, NutrientTransport, Else };
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. Smart_NTM
ReefAngel.DCPump.UseMemory=false;
ReefAngel.DCPump.Mode=NutrientTransport;
} else if (now()-feeding<2250) { // 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<27000 || now()%SECS_PER_DAY>=67500) { // 8:30am / 10:30pm
// Night mode (go to 30%)
ReefAngel.DCPump.UseMemory=false;
ReefAngel.DCPump.Mode=(Custom,ReefCrest(Tide.CalcSpeed()),-1Tide.isIncoming());
//ReefAngel.DCPump.Speed=30;
} else if (InternalMemory.DCPumpMode_read()==11) {
// Custom Mode and nothing else going on
ReefAngel.DCPump.UseMemory=false;
ReefAngel.DCPump.Duration=InternalMemory.DCPumpDuration_read();
if (modes[rmode]==Else) {
ReefAngel.DCPump.UseMemory=false;
ReefAngel.DCPump.Mode=Constant;
ReefAngel.DCPump.Speed=ElseMode(InternalMemory.DCPumpSpeed_read(),25,true ); // ElseMode on sync mode, Portal Speed Setting +/- 25%
} else {
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
}