Page 1 of 1

Icecool2's PDE

PostPosted: Wed Aug 19, 2015 4:44 pm
by icecool2
I'm getting my tank up and running again and to my dismay, I'm having a heck of a time getting my code onto the RA.

First off, my old code no longer compiles with the current version of libraries. No big deal, I used the wizard to write new code. Really basic stuff. BUT it is too big. How is that possible? I can't have the RA do it's basic functions and have the code fit on the thing anymore? Maybe I'm missing something.

Here's my code:
Code: Select all
#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_NokiaLCD.h>
#include <RA_ATO.h>
#include <RA_Joystick.h>
#include <LED.h>
#include <RA_TempSensor.h>
#include <Relay.h>
#include <RA_PWM.h>
#include <Timer.h>
#include <Memory.h>
#include <InternalEEPROM.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
//#include <Salinity.h>
#include <IO.h>
#include <AI.h>
#include <ReefAngel.h>

////// Place global variable code below here

// Port 1: Return Pump
// Port 2: Dead
// Port 3: Skimmer
// Port 4: Heater
// Port 5: Kessil
// Port 6: Wavemaker
// Port 7: Sump Light
// Port 8: Unused

////// Place global variable code above here

void setup()
    // This must be the first line
    ReefAngel.Init();  //Initialize controller
    ReefAngel.AddStandardMenu();  // Add Standard Menu

    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = Port1Bit | Port6Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port1Bit | Port6Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = 0;
    // Ports turned off when Overheat temperature exceeded
    //ReefAngel.OverheatShutoffPorts = 0;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
   // ReefAngel.OverheatProbe = T1_PROBE;
    // Set the Overheat temperature setting
    //InternalMemory.OverheatTemp_write( 869 );

    // Ports that are always on
    ReefAngel.Relay.On( Port1 );
    ReefAngel.Relay.On( Port3 );
    ReefAngel.Relay.On( Port7 );

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

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

void loop()
    ReefAngel.StandardHeater( Port4,751,761 );
    ReefAngel.StandardLights( Port5,9,0,19,0 );
    //ReefAngel.Wavemaker( Port6,60 );
    ReefAngel.PWM.SetDaylight( PWMParabola(11,0,18,0,13,50,13) );
    ReefAngel.PWM.SetActinic( PWMParabola(9,0,19,0,13,100,13) );
    ////// Place your custom code below here

    ////// Place your custom code above here

    // This should always be the last line

I commented out everything I could think of and I'm still too large.

Re: Icecool2's PDE

PostPosted: Wed Aug 19, 2015 5:05 pm
by rimai
Remove the standard menu.
Code: Select all
ReefAngel.AddStandardMenu();  // Add Standard Menu

Re: Icecool2's PDE

PostPosted: Wed Aug 19, 2015 5:35 pm
by icecool2
Closer, but still too big.

Is there a more compact function for ramping the LEDs? This is for a Kessil, perhaps there's a library for that? Removing both gets me just under the limit.

Re: Icecool2's PDE

PostPosted: Thu Aug 20, 2015 4:16 am
by icecool2
I see there's a "new" bootloader available "optiboot". That frees up 2k of space. I'd have to buy a ISP, but that's only $10.

My concern is that even with that extra 2k I get back, I still won't be able to use any additional modules. Like the Wifi module.

Re: Icecool2's PDE

PostPosted: Thu Aug 20, 2015 8:33 am
by rimai
It still needs ISP.
You can send it back and I can burn the new bootloader if you would like to.
You can also dowgrade to an earlier release libraries:

Re: Icecool2's PDE

PostPosted: Thu Aug 20, 2015 8:46 am
by icecool2
I ordered the ISP. Should be here Saturday.

Do the earlier libraries include the Wizard? How many versions back do you suggest I try to fit in the 32k?

Re: Icecool2's PDE

PostPosted: Thu Aug 20, 2015 8:48 am
by rimai
The libraries version should be independent of the wizard for the most part, unless you try to use a feature that wasn't added in the previous version of the libraries.
I think if you go to 1.0.8, you should be good.

Re: Icecool2's PDE

PostPosted: Thu Aug 20, 2015 8:53 am
by icecool2
I dropped back to 1.0 and it is under 29k now with Wifi enabled. Looks like I don't need that ISP after all.

Re: Icecool2's PDE

PostPosted: Thu Aug 20, 2015 9:02 am
by icecool2
Just tried 1.0.8 and still good. 28.2k with everything turned on.

Thanks for the help!