Need some help fast!

Share you PDE file with our community
Post Reply
simplefound
Posts: 8
Joined: Fri Aug 17, 2012 11:31 am

Need some help fast!

Post by simplefound »

Hi guys

Recently bought a reef angel and am having all sorts of problems with my code.
Here's a quick rundown
I have a steves leds setup in my tank and am trying to control them via PWM

I have managed to get the reefangel into initial internal memory where it now says "you can now upload your own ino code"

I have done my internal code in the reef angel generator
thats below;

// Autogenerated file by RAGen (v1.2.2.171), (08/17/2012 19:27)
// Memory_081712_1927.pde
//
// This file sets the default values to the Internal Memory
//


#include <ReefAngel_Features.h>
#include <ReefAngel_Globals.h>
#include <Time.h>
#include <OneWire.h>
#include <Phillips6610LCDInv.h>
#include <avr/pgmspace.h>
#include <ReefAngel_EEPROM.h>


Phillips6610LCDInv e;

void setup()
{
e.lcd_init();
e.lcd_clear(COLOR_WHITE,0,0,132,132);
e.lcd_BacklightOn();

InternalMemory.MHOnHour_write(23);
InternalMemory.MHOnMinute_write(0);
InternalMemory.MHOffHour_write(10);
InternalMemory.MHOffMinute_write(0);
InternalMemory.StdLightsOnHour_write(10);
InternalMemory.StdLightsOnMinute_write(45);
InternalMemory.StdLightsOffHour_write(23);
InternalMemory.StdLightsOffMinute_write(0);
InternalMemory.WM1Timer_write(200);
InternalMemory.WM2Timer_write(354);
InternalMemory.DP1Timer_write(10);
InternalMemory.DP2Timer_write(10);
InternalMemory.FeedingTimer_write(900);
InternalMemory.LCDTimer_write(600);
InternalMemory.OverheatTemp_write(1000);
InternalMemory.LEDPWMDaylight_write(50);
InternalMemory.LEDPWMActinic_write(50);
InternalMemory.HeaterTempOn_write(785);
InternalMemory.HeaterTempOff_write(791);
InternalMemory.ChillerTempOn_write(810);
InternalMemory.ChillerTempOff_write(793);
InternalMemory.ATOTimeout_write(60);
InternalMemory.PHMax_write(840);
InternalMemory.PHMin_write(550);
InternalMemory.MHDelay_write(5);
InternalMemory.DP1OnHour_write(20);
InternalMemory.DP1OnMinute_write(0);
InternalMemory.DP2OnHour_write(22);
InternalMemory.DP2OnMinute_write(30);
InternalMemory.ATOHourInterval_write(0);
InternalMemory.ATOHighHourInterval_write(0);
InternalMemory.ATOHighTimeout_write(60);
InternalMemory.DP1RepeatInterval_write(0);
InternalMemory.DP2RepeatInterval_write(0);
InternalMemory.SalMax_write(2550);
InternalMemory.PWMSlopeStartD_write(0);
InternalMemory.PWMSlopeEndD_write(100);
InternalMemory.PWMSlopeDurationD_write(60);
InternalMemory.PWMSlopeStartA_write(0);
InternalMemory.PWMSlopeEndA_write(85);
InternalMemory.PWMSlopeDurationA_write(60);
InternalMemory.RFMode_write(0);
InternalMemory.RFSpeed_write(100);
InternalMemory.RFDuration_write(10);
}

void loop()
{
// display the values
char buf[128];
sprintf(buf, "MH %2d:%02d-%2d:%02d,%d", InternalMemory.MHOnHour_read(), InternalMemory.MHOnMinute_read(),
InternalMemory.MHOffHour_read(), InternalMemory.MHOffMinute_read(),
InternalMemory.MHDelay_read());
e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW, buf);
sprintf(buf, "Std %2d:%02d-%2d:%02d", InternalMemory.StdLightsOnHour_read(), InternalMemory.StdLightsOnMinute_read(),
InternalMemory.StdLightsOffHour_read(), InternalMemory.StdLightsOffMinute_read());
e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*2, buf);
sprintf(buf, "LED A: %d%% D: %d%%", InternalMemory.LEDPWMActinic_read(), InternalMemory.LEDPWMDaylight_read());
e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*3, buf);
sprintf(buf, "WM1: %ds", InternalMemory.WM1Timer_read());
e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*4, buf);
sprintf(buf, "WM2: %ds", InternalMemory.WM2Timer_read());
e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*5, buf);
sprintf(buf, "F: %ds", InternalMemory.FeedingTimer_read());
e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*6, buf);
sprintf(buf, "S: %ds", InternalMemory.LCDTimer_read());
e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*7, buf);
sprintf(buf, "H On: %d -> %d", InternalMemory.HeaterTempOn_read(), InternalMemory.HeaterTempOff_read());
e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*9, buf);
sprintf(buf, "C On: %d -> %d", InternalMemory.ChillerTempOn_read(), InternalMemory.ChillerTempOff_read());
e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*10, buf);
sprintf(buf, "PH %d - %d", InternalMemory.PHMax_read(), InternalMemory.PHMin_read());
e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*11, buf);

delay(10000);
e.lcd_clear(COLOR_WHITE,0,0,132,132);

sprintf(buf, "OH: %dF", InternalMemory.OverheatTemp_read());
e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW, buf);
sprintf(buf, "ATO L: %ds (%dh)", InternalMemory.ATOTimeout_read(), InternalMemory.ATOHourInterval_read());
e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*2, buf);
sprintf(buf, "ATO H: %ds (%dh)", InternalMemory.ATOHighTimeout_read(), InternalMemory.ATOHighHourInterval_read());
e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*3, buf);

sprintf(buf, "DP1: %2d:%02d", InternalMemory.DP1OnHour_read(), InternalMemory.DP1OnMinute_read());
e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*5, buf);
sprintf(buf, " %ds", InternalMemory.DP1Timer_read());
e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*6, buf);
sprintf(buf, "DP2: %2d:%02d", InternalMemory.DP2OnHour_read(), InternalMemory.DP2OnMinute_read());
e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*7, buf);
sprintf(buf, " %ds", InternalMemory.DP2Timer_read());
e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*8, buf);

delay(10000);
e.lcd_clear(COLOR_WHITE,0,0,132,132);
}


Errors;










The following features were automatically added:
Watchdog Timer
Version Menu

The following features were detected:
Simple Menu
Memory_081712_1927___Internal.cpp: In function 'void setup()':
Memory_081712_1927___Internal:21: error: 'COLOR_WHITE' was not declared in this scope
Memory_081712_1927___Internal:24: error: 'InternalMemory' was not declared in this scope
Memory_081712_1927___Internal.cpp: In function 'void loop()':
Memory_081712_1927___Internal:74: error: 'InternalMemory' was not declared in this scope
Memory_081712_1927___Internal:77: error: 'COLOR_BLACK' was not declared in this scope
Memory_081712_1927___Internal:77: error: 'COLOR_WHITE' was not declared in this scope
Memory_081712_1927___Internal:77: error: 'MENU_START_COL' was not declared in this scope
Memory_081712_1927___Internal:77: error: 'MENU_START_ROW' was not declared in this scope






Here is the code that is generated once i have selected everything in reef angel generator


// Autogenerated file by RAGen (v1.2.2.171), (08/17/2012 19:28)
// RA_081712_1928.pde
//
// This version designed for v0.8.5 Beta 17 or later

/* The following features are enabled for this File:
#define DisplayImages
#define DateTimeSetup
#define VersionMenu
#define DirectTempSensor
#define DisplayLEDPWM
#define WDT
#define SIMPLE_MENU
*/


#include <ReefAngel_Features.h>
#include <ReefAngel_Globals.h>
#include <ReefAngel_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <ReefAngel_EEPROM.h>
#include <ReefAngel_NokiaLCD.h>
#include <ReefAngel_ATO.h>
#include <ReefAngel_Joystick.h>
#include <ReefAngel_LED.h>
#include <ReefAngel_TempSensor.h>
#include <ReefAngel_Relay.h>
#include <ReefAngel_PWM.h>
#include <ReefAngel_Timer.h>
#include <ReefAngel_Memory.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 = B00000000;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = B00001000;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = B00000010;

// Ports that are always on
ReefAngel.Relay.On(Port5);
ReefAngel.Relay.On(Port6);
ReefAngel.Relay.On(Port8);
////// Place additional initialization code below here


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

void loop()
{
// Specific functions that use Internal Memory values
ReefAngel.StandardATO(Port1);
ReefAngel.StandardLights(Port2);
ReefAngel.MHLights(Port3);
ReefAngel.StandardFan(Port4);
ReefAngel.StandardHeater(Port7);

ReefAngel.PWM.SetActinic(PWMSlope(
InternalMemory.StdLightsOnHour_read(),
InternalMemory.StdLightsOnMinute_read(),
InternalMemory.StdLightsOffHour_read(),
InternalMemory.StdLightsOffMinute_read(),
InternalMemory.PWMSlopeStartA_read(),
InternalMemory.PWMSlopeEndA_read(),
InternalMemory.PWMSlopeDurationA_read(),
ReefAngel.PWM.GetActinicValue()
));
ReefAngel.PWM.SetDaylight(PWMSlope(
InternalMemory.StdLightsOnHour_read(),
InternalMemory.StdLightsOnMinute_read(),
InternalMemory.StdLightsOffHour_read(),
InternalMemory.StdLightsOffMinute_read(),
InternalMemory.PWMSlopeStartD_read(),
InternalMemory.PWMSlopeEndD_read(),
InternalMemory.PWMSlopeDurationD_read(),
ReefAngel.PWM.GetDaylightValue()
));
////// Place your custom code below here


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

// This should always be the last line
ReefAngel.ShowInterface();
}



Errors;











The following features were automatically added:
Watchdog Timer
Version Menu

The following features were detected:
Dimming Signal
Simple Menu
In file included from RA_081712_1928___relay.cpp:34:
C:\Users\Simon Tollworthy\Documents\Arduino\libraries\ReefAngel/ReefAngel.h:86: error: 'ParamsStruct' does not name a type
C:\Users\Simon Tollworthy\Documents\Arduino\libraries\ReefAngel/ReefAngel.h:88: error: 'RA_NokiaLCD' does not name a type
C:\Users\Simon Tollworthy\Documents\Arduino\libraries\ReefAngel/ReefAngel.h:89: error: 'RA_JoystickClass' does not name a type
C:\Users\Simon Tollworthy\Documents\Arduino\libraries\ReefAngel/ReefAngel.h:90: error: 'LEDClass' does not name a type
C:\Users\Simon Tollworthy\Documents\Arduino\libraries\ReefAngel/ReefAngel.h:92: error: 'RA_ATOHighClass' does not name a type
C:\Users\Simon Tollworthy\Documents\Arduino\libraries\ReefAngel/ReefAngel.h:93: error: 'RA_ATOLowClass' does not name a type
C:\Users\Simon Tollworthy\Documents\Arduino\libraries\ReefAngel/ReefAngel.h:94: error: 'RA_TempSensorClass' does not name a type
C:\Users\Simon Tollworthy\Documents\Arduino\libraries\ReefAngel/ReefAngel.h:95: error: 'RelayClass' does not name a type
C:\Users\Simon Tollworthy\Documents\Arduino\libraries\ReefAngel/ReefAngel.h:97: error: 'RA_PWMClass' does not name a type
C:\Users\Simon Tollworthy\Documents\Arduino\libraries\ReefAngel/ReefAngel.h:133: error: 'TimerClass' does not name a type
C:\Users\Simon Tollworthy\Documents\Arduino\libraries\ReefAngel/ReefAngel.h:302: error: 'Total_Menus' was not declared in this scope
C:\Users\Simon Tollworthy\Documents\Arduino\libraries\ReefAngel/ReefAngel.h:303: error: 'Total_Menus' was not declared in this scope
RA_081712_1928___relay.cpp: In function 'void setup()':
RA_081712_1928___relay:54: error: 'class ReefAngelClass' has no member named 'Relay'
RA_081712_1928___relay:54: error: 'Port5' was not declared in this scope
RA_081712_1928___relay:55: error: 'class ReefAngelClass' has no member named 'Relay'
RA_081712_1928___relay:55: error: 'Port6' was not declared in this scope
RA_081712_1928___relay:56: error: 'class ReefAngelClass' has no member named 'Relay'
RA_081712_1928___relay:56: error: 'Port8' was not declared in this scope
RA_081712_1928___relay.cpp: In function 'void loop()':
RA_081712_1928___relay:66: error: 'Port1' was not declared in this scope
RA_081712_1928___relay:67: error: 'Port2' was not declared in this scope
RA_081712_1928___relay:68: error: 'Port3' was not declared in this scope
RA_081712_1928___relay:69: error: 'Port4' was not declared in this scope
RA_081712_1928___relay:70: error: 'Port7' was not declared in this scope
RA_081712_1928___relay:72: error: 'class ReefAngelClass' has no member named 'PWM'
RA_081712_1928___relay:73: error: 'InternalMemory' was not declared in this scope
RA_081712_1928___relay:80: error: 'class ReefAngelClass' has no member named 'PWM'
RA_081712_1928___relay:81: error: 'PWMSlope' was not declared in this scope
RA_081712_1928___relay:82: error: 'class ReefAngelClass' has no member named 'PWM'
RA_081712_1928___relay:90: error: 'class ReefAngelClass' has no member named 'PWM'



Sorry this is a really long post but i really need to get my lights working by the end of tonight
Please be simple with me. I am very new to arduino coding and so dont have a clue

Look forward to hearing from any responses

Simon
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Need some help fast!

Post by lnevo »

It seems like you have added quite a lot and maybe should back some of it out first. A lot of your errors seem due to missing #include files as its claiming a lot of things are undeclared.

I recommend using the Wizard (Tools->Reef Angel Wizard), RAGen, or the Template (under File->Sketchbook->Example Codes). I also would not recommend using the file to initialize the memory variables as a starting point.

Get a simple INO file compiled and working and then add the bits of code you are trying to add. I also recommend looking over more of the example code as it seems you are using some of the real low classes for writing to the LCD and such. In my opinion you are better off using the higher level classes and methods.

Good Luck, keep us posted :)
simplefound
Posts: 8
Joined: Fri Aug 17, 2012 11:31 am

Re: Need some help fast!

Post by simplefound »

Hello thanks for the advise, all the code I have shown was generated by RAGen.
I now have it up and running I used the wizard but was still having trouble with the pwm dimming, finally got to the bottom of it when I connected the pwm wires to the led driver I removed the original dimmer switches, but it appears I needed to leave those connected

Many thanks
divingdon
Posts: 57
Joined: Tue Mar 22, 2011 8:35 pm

Re: Need some help fast!

Post by divingdon »

SimpleFound,

How did you correct this problem. I am having the same issue

Any help anyone

The following features were detected:
Simple Menu
In file included from RA_082212_2202.cpp:30:
C:\Documents and Settings\Don\My Documents\Arduino\libraries\ReefAngel/ReefAngel.h:86: error: 'ParamsStruct' does not name a type
C:\Documents and Settings\Don\My Documents\Arduino\libraries\ReefAngel/ReefAngel.h:88: error: 'RA_NokiaLCD' does not name a type
C:\Documents and Settings\Don\My Documents\Arduino\libraries\ReefAngel/ReefAngel.h:89: error: 'RA_JoystickClass' does not name a type
C:\Documents and Settings\Don\My Documents\Arduino\libraries\ReefAngel/ReefAngel.h:90: error: 'LEDClass' does not name a type
C:\Documents and Settings\Don\My Documents\Arduino\libraries\ReefAngel/ReefAngel.h:92: error: 'RA_ATOHighClass' does not name a type
C:\Documents and Settings\Don\My Documents\Arduino\libraries\ReefAngel/ReefAngel.h:93: error: 'RA_ATOLowClass' does not name a type
C:\Documents and Settings\Don\My Documents\Arduino\libraries\ReefAngel/ReefAngel.h:94: error: 'RA_TempSensorClass' does not name a type
C:\Documents and Settings\Don\My Documents\Arduino\libraries\ReefAngel/ReefAngel.h:95: error: 'RelayClass' does not name a type
C:\Documents and Settings\Don\My Documents\Arduino\libraries\ReefAngel/ReefAngel.h:133: error: 'TimerClass' does not name a type
C:\Documents and Settings\Don\My Documents\Arduino\libraries\ReefAngel/ReefAngel.h:302: error: 'Total_Menus' was not declared in this scope
C:\Documents and Settings\Don\My Documents\Arduino\libraries\ReefAngel/ReefAngel.h:303: error: 'Total_Menus' was not declared in this scope
RA_082212_2202.cpp: In function 'void setup()':
RA_082212_2202.pde:-1: error: 'class ReefAngelClass' has no member named 'Relay'
RA_082212_2202.pde:-1: error: 'Port8' was not declared in this scope
RA_082212_2202.cpp: In function 'void loop()':
RA_082212_2202.pde:-1: error: 'Port1' was not declared in this scope
RA_082212_2202.pde:-1: error: 'Port2' was not declared in this scope
RA_082212_2202.pde:-1: error: 'Port3' was not declared in this scope
RA_082212_2202.pde:-1: error: 'Port4' was not declared in this scope
RA_082212_2202.pde:-1: error: 'Port5' was not declared in this scope
RA_082212_2202.pde:-1: error: 'Port6' was not declared in this scope
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Need some help fast!

Post by rimai »

Can I see the code?
Seems like you are trying to use a code that was generated for an outdated set of libraries.
Roberto.
divingdon
Posts: 57
Joined: Tue Mar 22, 2011 8:35 pm

Re: Need some help fast!

Post by divingdon »

I'm running ver 1.0.1 and made sure that i was up to date using the lib updater. I am still having the same problem
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Need some help fast!

Post by rimai »

Hum, maybe you ought to install the RA Installer again.
The library update utility has been deprecated starting on ver 1.0.0
The new RA Installer comes with several goodies including automatic library update check, so you better of getting the whole package of files with the new RA installer.
Or, it could be that your code is written for the outdated libraries and needs to be recoded. That's why I asked for the code.
Roberto.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Need some help fast!

Post by rimai »

If you install again, please rename the folder "Documents\Arduino" to something else just to make sure you will get a fresh copy of the libraries and will not have mismatched libraries laying around.
Roberto.
divingdon
Posts: 57
Joined: Tue Mar 22, 2011 8:35 pm

Re: Need some help fast!

Post by divingdon »

I completely removed everything again and reinstalled and then tried to generate a code and had the same issues on generate a memory sketch and a sketch and they both failed.
Attachments
RA_082212_2323.ino
(3.29 KiB) Downloaded 566 times
Memory_082212_2322.ino
(5.82 KiB) Downloaded 562 times
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Need some help fast!

Post by rimai »

Now I know what you are doing wrong.
You are using old RAGen.
It's generating codes meant for very old libraries.
If you want to use RAGen, you need to use the version that comes with the RA Installer.
v1.2.2.171
Otherwise, try the Reef Angel Wizard. It's much simpler and easier to use :)
Tools->Reef Angel Wizard
Roberto.
Post Reply