Sketch too large with PWM Controlls

Related to the development libraries, released by Curt Binder

Posts: 17
Joined: Fri Mar 02, 2012 10:27 am
PostPosted: Sun Mar 23, 2014 8:58 pm
I'm sure you've heard it all before but here's my story:

I've had my RA for a little over 2 years (Back before the Plus was available) and been running my lights on just the standard timed outlets.
Well I got bored over the weekend so I re-wired my light fixture with new drivers so I could PWM dim my lights. Unfortunately when I went through the wizard and re-built my code with the Dimming controls in it couldn't upload saying the sketch was too large. Took the Dimming out again and had no problems. I was running the 1.1.0 lib so i eventually downgraded my lib to 1.0.7 and got the sketch to upload. So I've got it working but the WiFi just doesn't seem as stable on 1.0.7 and the Direct web login to my controller doesn't work anymore when it did on 1.1.0.

Suggestions to get my code down to size on 1.1.0 and keep my PWM control?
User avatar
Posts: 5416
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Mon Mar 24, 2014 3:42 am
Post the code please

Posts: 17
Joined: Fri Mar 02, 2012 10:27 am
PostPosted: Sat Apr 12, 2014 2:18 pm
Here's the code that works with 1.0.7
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 <RF.h>
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <PH.h>
#include <WaterLevel.h>
#include <Humidity.h>
#include <DCPump.h>
#include <ReefAngel.h>

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

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

void setup()
    // This must be the first line
    ReefAngel.Init();  //Initialize controller
    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = Port3Bit | Port4Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port3Bit | Port4Bit | Port8Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = Port1Bit | Port2Bit | Port7Bit;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port4Bit | Port6Bit;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;

    // Ports that are always on
    ReefAngel.Relay.On( Port5 );
    ReefAngel.Relay.On( Port8 );

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

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

void loop()
    ReefAngel.DayLights( Port1 );
    ReefAngel.ActinicLights( Port2 );
    ReefAngel.StandardATO( Port3 );
    ReefAngel.Relay.DelayedOn( Port4 );
    ReefAngel.StandardHeater( Port6 );
    ////// Place your custom code below here

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

    // This should always be the last line
    ReefAngel.Portal( "pyroboy1der" );

I also tried versions with variables in the code but had the same issue. Only difference is lib version and it fits with 1.0.7 and now with 1.1.0
User avatar
Posts: 5416
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Sat Apr 12, 2014 3:50 pm
Your code is about as compact as it gets. My suggestion is stick with 1.0.7

Posts: 52
Joined: Thu May 23, 2013 2:19 pm
PostPosted: Mon Apr 14, 2014 7:54 pm
You can comment out the feeding mode ports and just use water change when feeding. Though it wont be timed. Since I don't see an overheat temp defined you can comment out the overheat ports and comment out the overheatprobe = t1-probe.

Return to Development Libraries

Who is online

Users browsing this forum: No registered users and 2 guests