Re: ATO container low
Posted: Mon Jan 15, 2018 8:03 pm
My bad, I missed the semi-colon. Here's the code that compiles:Swampfox wrote:Binder I tried to upload the code, but it is saying "firmware.ino:22:1: error: expected initializer before 'void'
void if (ReefAngel.LowATO.IsActive() ) {" It also had a error for no semi colon after the finial }, but I added it. I just don't know what to put in to fix there expected initializer.
Also what cause this when i try to upload to my controller?
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
Could not program the board
Code: Select all
if(ReefAngel.LowATO.IsActive()) {
ReefAngel.LED.On();
bitSet(ReefAngel.AlertFlags, ATOTimeOutFlag);
}
It needs to go after the "////// Place your custom code below here" line.
Code: Select all
void loop()
{
// WM 1 / Left, 1 minute delay
ReefAngel.Relay.DelayedOn( Port2, 1 );
// WM 2 / Right, 1 minute delay
ReefAngel.Relay.DelayedOn( Port6, 1 );
ReefAngel.StandardHeater( Port3 );
// Dimmable lights, ballasts plugged into relay
ReefAngel.DayLights( Port7 );
// Non-dimmable lights
// plugged into relay port along with fan power supply
// comes on 1 hour after daylights and
// shuts off 1 hour before daylights
ReefAngel.StandardLights(Port8,
InternalMemory.StdLightsOnHour_read()+1,
InternalMemory.StdLightsOnMinute_read(),
InternalMemory.StdLightsOffHour_read()-1,
InternalMemory.StdLightsOffMinute_read());
ReefAngel.PWM.DaylightPWMSlope();
ReefAngel.PWM.ActinicPWMSlope();
////// Place your custom code below here
////////////// THIS CODE IS ADDED FOR THE ATO FUNCTIONALITY
if(ReefAngel.LowATO.IsActive()) {
ReefAngel.LED.On();
bitSet(ReefAngel.AlertFlags, ATOTimeOutFlag);
}
////// Place your custom code above here
// This should always be the last line
//ReefAngel.Portal( "binder" );
ReefAngel.ShowInterface();
}
As for the avrdude timeout, that can be various causes. Best suggestion is to keep the controller unplugged until you are certain you want to upload the code. Then plug it in. For whatever reason, arduino is timing out talking to the controller. It happens from time to time and I don't have a good reason why.