here is my PDE i think i am close :D

Share you PDE file with our community
Post Reply
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: here is my PDE i think i am close :D

Post by binder »

just tested out the code and it works fine. i copied & pasted what you posted as your pde file and the same with your features file. compiled just fine.

what version of the libraries are you running?
what does your reefangel.h file look like?
when you are making the changes with the libraries, you must have arduino closed out for the changes to be recognized.
it sounds like you are not getting some features included, ie, it acts like wifi and DisplayLEDPWM are not defined.

with arduino opened up, goto the File menu and select Preferences. Make sure that the Sketchbook location is the same folder that you are editing your pde file in. Also make sure that sketch folder has a libraries subfolder.

curt
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: here is my PDE i think i am close :D

Post by rimai »

Yeah, same here.
I compiled fine, but when I commented wifi and DisplayLEDPWM, I got the exact same errors you posted above.
Roberto.
chridijon
Posts: 26
Joined: Mon Sep 12, 2011 11:06 pm

Re: here is my PDE i think i am close :D

Post by chridijon »

ok not really sure how but, i got it mostly.

here is PDE file:

// Autogenerated file by RAGen (v1.0.4.92), (10/05/2011 22:47)
// RA_100511_2247.pde
//
// This version designed for v0.8.5 Beta 12 or later

/* The following features are enabled for this PDE File:
#define DisplayImages
#define DisplayLEDPWM
#define wifi
#define RelayExp
*/
#include <ReefAngel_CustomColors.h>
#include <ReefAngel_Colors.h>
#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>


void DrawCustomMain()
{
byte x = 6;
byte y = 2;
byte t;
ReefAngel.LCD.DrawDate(6, 2);
ReefAngel.LCD.Clear(COLOR_BLACK, 1, 11, 132, 11);
pingSerial();
x = 12;
y += MENU_START_ROW+1;
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.PWM.GetDaylightValue(),
DPColor, x, y, 1);
t = intlength(ReefAngel.PWM.GetDaylightValue()) + 1;
t *= 5;
ReefAngel.LCD.DrawText(DPColor, DefaultBGColor, x+t, y, "%");
t += 10;
x += t;
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.PWM.GetActinicValue(),
APColor, x, y, 1);
t = intlength(ReefAngel.PWM.GetActinicValue()) + 1;
t *= 5;
ReefAngel.LCD.DrawText(APColor, DefaultBGColor, x+t, y, "%");
t += 10;
x += t;
char text[7];
ConvertNumToString(text, ReefAngel.Params.PH, 100);
ReefAngel.LCD.Clear(DefaultBGColor, x+16, y, x+45, y+16);
ReefAngel.LCD.DrawLargeText(PHColor, DefaultBGColor, x+16, y, text,
Num8x16);
pingSerial();
ConvertNumToString(text, ReefAngel.Params.Temp1, 10);
y += MENU_START_ROW*2;
x = 10;
ReefAngel.LCD.Clear(DefaultBGColor,x,y,x+(16*4),y+16);
pingSerial();
ReefAngel.LCD.DrawHugeNumbers(T1TempColor, DefaultBGColor, x, y, text);
pingSerial();
x += (16*4) + 8;
ReefAngel.LCD.DrawText(T2TempColor,DefaultBGColor,x,y,"Hood:");
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp2, T2TempColor,
x+18, y, 10);
ReefAngel.LCD.DrawText(T3TempColor,DefaultBGColor,x,y+10,"LED:");
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp3, T3TempColor,
x+18, y+10, 10);
y += 16*2;
x = 12;
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox(x, y, TempRelay);
}
void DrawCustomGraph()
{
}




// Labels for the web banner
#include <avr/pgmspace.h>
prog_char id_label[] PROGMEM = "67_kevin";
prog_char probe1_label[] PROGMEM = "Water";
prog_char probe2_label[] PROGMEM = "Room";
prog_char probe3_label[] PROGMEM = "Lights";
prog_char relay1_label[] PROGMEM = "Day";
prog_char relay2_label[] PROGMEM = "Day";
prog_char relay3_label[] PROGMEM = "Day";
prog_char relay4_label[] PROGMEM = "Actinic";
prog_char relay5_label[] PROGMEM = "Actinic";
prog_char relay6_label[] PROGMEM = "Actinic";
prog_char relay7_label[] PROGMEM = "Hood Fan";
prog_char relay8_label[] PROGMEM = "Light Fan";
prog_char relay11_label[] PROGMEM = "Skimmer";
prog_char relay12_label[] PROGMEM = "Sump";
prog_char relay13_label[] PROGMEM = "CO2";
prog_char relay14_label[] PROGMEM = "Vortech";
prog_char relay15_label[] PROGMEM = "Vortech";
prog_char relay16_label[] PROGMEM = "Vortech";
prog_char relay17_label[] PROGMEM = "Return";
prog_char relay18_label[] PROGMEM = "extra";

PROGMEM const char *webbanner_items[] = {
id_label, probe1_label, probe2_label, probe3_label, relay1_label, relay2_label,
relay3_label, relay4_label, relay5_label, relay6_label, relay7_label, relay8_label,
relay11_label, relay12_label, relay13_label, relay14_label, relay15_label, relay16_label, relay17_label, relay18_label};

void setup()
{
ReefAngel.Init(); //Initialize controller
// Initialize and start the web banner timer
ReefAngel.LoadWebBanner(pgm_read_word(&(webbanner_items[0])), SIZE(webbanner_items));
ReefAngel.Timer[4].SetInterval(180); // set interval to 180 seconds
ReefAngel.Timer[4].Start();

// Ports that are always on
ReefAngel.Relay.On(Box1_Port1);
ReefAngel.Relay.On(Box1_Port2);
ReefAngel.Relay.On(Box1_Port3);
ReefAngel.Relay.On(Box1_Port4);
ReefAngel.Relay.On(Box1_Port5);
ReefAngel.Relay.On(Box1_Port6);
ReefAngel.Relay.On(Box1_Port7);
ReefAngel.Relay.On(Box1_Port8);
}



void loop()
{
ReefAngel.ShowInterface();

// Specific functions
ReefAngel.StandardLights(Port1,8,0,21,0);
ReefAngel.StandardLights(Port2,8,0,21,0);
ReefAngel.StandardLights(Port3,8,0,21,0);
ReefAngel.StandardLights(Port4,7,0,22,0);
ReefAngel.StandardLights(Port5,7,0,22,0);
ReefAngel.StandardLights(Port6,7,0,22,0);
ReefAngel.StandardFan(Port7);
ReefAngel.StandardFan(Port8);


ReefAngel.PWM.SetActinic(PWMSlope(7,0,22,0,0,100,60,ReefAngel.PWM.GetActinicValue()));
ReefAngel.PWM.SetDaylight(PWMSlope(8,0,21,0,0,100,60,ReefAngel.PWM.GetDaylightValue()));


// Web Banner stuff
if(ReefAngel.Timer[4].IsTriggered())
{
ReefAngel.Timer[4].Start();
ReefAngel.WebBanner();
}
}

and my Feature file:


#ifndef __REEFANGEL_FEATURES_H__
#define __REEFANGEL_FEATURES_H__

#define SIMPLE_MENU
#define COLORS_PDE
#define NUMBERS_8x16
#define NUMBERS_16x16
#define CUSTOM_MAIN
#define InstalledRelayExpansionModules 1
#define DisplayLEDPWM
#define wifi
#define RelayExp
#define StandardLightSetup


#endif // __REEFANGEL_FEATURES_H__

however as im sure you can see i added a custom menu however i cant see it because the LCD screen if off unless i move the joystick. is that due to the #define SIMPLE_MENU ?
Image
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: here is my PDE i think i am close :D

Post by binder »

The PDE compiles just fine and the screen shows up just fine without moving the joystick.

The problem most likely is with the LCD Timeout value. That value is probably set to 0 or something very small which means that the screen turns off almost immediately after releasing the joystick or turning on the controller.

There are 3 ways to fix it.
1. Grab my Status App and update the memory value for the LCD Feeding timer.
2. Load up the InternalMemory pde file to update the memory (this will update all values in memory to whatever you put in the file).
3. Copy & Paste this line into your web browser (replacing the IP address with the IP address of your controller) to reset the LCD Timer to it's default value.

Code: Select all

http://192.168.0.100:2000/mi816,600
Where 192.168.0.100 is the IP address of your controller.

600 is the default value for the LCD Timer.

curt
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: here is my PDE i think i am close :D

Post by rimai »

It always happens to me too. :(
I know the minute it happens what to do, but I think it is indeed unexpected to see it happening.
Can we have a quick internal check that doesn't let the LCD timeout be less than 60 seconds?
Roberto.
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: here is my PDE i think i am close :D

Post by binder »

rimai wrote:It always happens to me too. :(
I know the minute it happens what to do, but I think it is indeed unexpected to see it happening.
Can we have a quick internal check that doesn't let the LCD timeout be less than 60 seconds?
Sure thing. I'll put it in next release.

curt
chridijon
Posts: 26
Joined: Mon Sep 12, 2011 11:06 pm

Re: here is my PDE i think i am close :D

Post by chridijon »

OK next dumb question. Does the controller just know what outlets I am using for my actinics and daylight LED or is there special code that i need to put in? I will be using outlet 1,2, 3 for daylight and 4,5, 6 for actinics. And one other thing for some reason outlet 3 doesn't come on, even when I go to the IP address and manually put it on auto or on, when it refreshes it goes to off.
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: here is my PDE i think i am close :D

Post by rimai »

No, it does not know which are daylight and which are actinic.
Looks like you are getting overheat flag problem.
You need this line just below ReefAngel.Init()

Code: Select all

  ReefAngel.OverheatShutoffPorts = B00000000;
Roberto.
chridijon
Posts: 26
Joined: Mon Sep 12, 2011 11:06 pm

Re: here is my PDE i think i am close :D

Post by chridijon »

OK thanks for the fix for outlet 3. Where would I find the code to tell the head unit which is daylight and actinics?
Image
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: here is my PDE i think i am close :D

Post by binder »

chridijon wrote:OK thanks for the fix for outlet 3. Where would I find the code to tell the head unit which is daylight and actinics?
it's just as simple as:

Code: Select all

ReefAngel.StandardLights(Port3);
and

Code: Select all

ReefAngel.StandardLights(Port4);
Where Port3 would be your daylight and Port4 would be your actinics.

If you need them on a different schedule you could either use the long form of the StandardLights function or change one over to use the MHLights function that has the ability to put a minute delay on startup. The choice is up to you.

curt
chridijon
Posts: 26
Joined: Mon Sep 12, 2011 11:06 pm

Re: here is my PDE i think i am close :D

Post by chridijon »

OK so my code posted correct? Daylight on post 1,2, 3 to start ramp up at 8am and ramp down at 8pm and off at 9pm. And actinics on port 4,5, 6 ramp up at 7am and ramp down at 9pm and off at 10pm?
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: here is my PDE i think i am close :D

Post by rimai »

You got it :)
Roberto.
chridijon
Posts: 26
Joined: Mon Sep 12, 2011 11:06 pm

Re: here is my PDE i think i am close :D

Post by chridijon »

Woohoooo
Image
chridijon
Posts: 26
Joined: Mon Sep 12, 2011 11:06 pm

Re: here is my PDE i think i am close :D

Post by chridijon »

i'm back :D

ok i am trying to get my fans to come on with temp readings. but the fans just stay on and never go off. 1 is for my led fans the other is my hood fan to cool down the water. here is the code:

// Autogenerated file by RAGen (v1.0.4.92), (10/05/2011 22:47)
// RA_100511_1921.pde
//
// This version designed for v0.8.5 Beta 12 or later

/* The following features are enabled for this PDE File:
#define DisplayImages
#define DisplayLEDPWM
#define wifi
#define RelayExp
*/
#include <ReefAngel_CustomColors.h>
#include <ReefAngel_Colors.h>
#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>


void DrawCustomMain()
{
byte x = 6;
byte y = 2;
byte t;
ReefAngel.LCD.DrawDate(6, 2);
ReefAngel.LCD.Clear(COLOR_BLACK, 1, 11, 132, 11);
pingSerial();
x = 12;
y += MENU_START_ROW+1;
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.PWM.GetDaylightValue(),
DPColor, x, y, 1);
t = intlength(ReefAngel.PWM.GetDaylightValue()) + 1;
t *= 5;
ReefAngel.LCD.DrawText(DPColor, DefaultBGColor, x+t, y, "%");
t += 10;
x += t;
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.PWM.GetActinicValue(),
APColor, x, y, 1);
t = intlength(ReefAngel.PWM.GetActinicValue()) + 1;
t *= 5;
ReefAngel.LCD.DrawText(APColor, DefaultBGColor, x+t, y, "%");
t += 10;
x += t;
char text[7];
ConvertNumToString(text, ReefAngel.Params.PH, 100);
ReefAngel.LCD.Clear(DefaultBGColor, x+16, y, x+45, y+16);
ReefAngel.LCD.DrawLargeText(PHColor, DefaultBGColor, x+16, y, text,
Num8x16);
pingSerial();
ConvertNumToString(text, ReefAngel.Params.Temp1, 10);
y += MENU_START_ROW*2;
x = 10;
ReefAngel.LCD.Clear(DefaultBGColor,x,y,x+(16*4),y+16);
pingSerial();
ReefAngel.LCD.DrawHugeNumbers(T1TempColor, DefaultBGColor, x, y, text);
pingSerial();
x += (16*4) + 8;
ReefAngel.LCD.DrawText(T2TempColor,DefaultBGColor,x,y,"Hood:");
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp2, T2TempColor,
x+18, y, 10);
ReefAngel.LCD.DrawText(T3TempColor,DefaultBGColor,x,y+10,"LED:");
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp3, T3TempColor,
x+18, y+10, 10);
y += 16*2;
x = 12;
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox(x, y, TempRelay);
}
void DrawCustomGraph()
{
}




// Labels for the web banner
#include <avr/pgmspace.h>
prog_char id_label[] PROGMEM = "67_kevin";
prog_char probe1_label[] PROGMEM = "Water";
prog_char probe2_label[] PROGMEM = "Room";
prog_char probe3_label[] PROGMEM = "Lights";
prog_char relay1_label[] PROGMEM = "Day";
prog_char relay2_label[] PROGMEM = "Day";
prog_char relay3_label[] PROGMEM = "Day";
prog_char relay4_label[] PROGMEM = "Actinic";
prog_char relay5_label[] PROGMEM = "Actinic";
prog_char relay6_label[] PROGMEM = "Actinic";
prog_char relay7_label[] PROGMEM = "Hood Fan";
prog_char relay8_label[] PROGMEM = "Light Fan";

PROGMEM const char *webbanner_items[] = {
id_label, probe1_label, probe2_label, probe3_label, relay1_label, relay2_label,
relay3_label, relay4_label, relay5_label, relay6_label, relay7_label, relay8_label};

void setup()
{
ReefAngel.Init(); //Initialize controller
ReefAngel.OverheatShutoffPorts = B00000000;
ReefAngel.PHMin=529;
ReefAngel.PHMax=819;
// turn on port 7 when temp gets above 79.0 and turn off when temp gets below 76.0
if (ReefAngel.Params.Temp3 >= 770 && ReefAngel.Params.Temp3 > 0) ReefAngel.Relay.On(Port7);
if (ReefAngel.Params.Temp3 <= 740) ReefAngel.Relay.Off(Port7);

// turn on port 8 when temp gets above 90.0 and turn off when temp gets below 75.0
if (ReefAngel.Params.Temp2 >= 850 && ReefAngel.Params.Temp2 > 0) ReefAngel.Relay.On(Port8);
if (ReefAngel.Params.Temp2 <= 750) ReefAngel.Relay.Off(Port8);

// Initialize and start the web banner timer
ReefAngel.LoadWebBanner(pgm_read_word(&(webbanner_items[0])), SIZE(webbanner_items));
ReefAngel.Timer[4].SetInterval(180); // set interval to 180 seconds
ReefAngel.Timer[4].Start();

// Ports that are always on

}



void loop()
{
ReefAngel.ShowInterface();

// Specific functions
ReefAngel.StandardLights(Port1,8,0,21,0);
ReefAngel.StandardLights(Port2,8,0,21,0);
ReefAngel.StandardLights(Port3,8,0,21,0);
ReefAngel.StandardLights(Port4,7,0,22,0);
ReefAngel.StandardLights(Port5,7,0,22,0);
ReefAngel.StandardLights(Port6,7,0,22,0);
ReefAngel.StandardFan(Port7);
ReefAngel.StandardFan(Port8);


ReefAngel.PWM.SetActinic(PWMSlope(7,0,22,0,0,100,60,ReefAngel.PWM.GetActinicValue()));
ReefAngel.PWM.SetDaylight(PWMSlope(8,0,21,0,0,100,60,ReefAngel.PWM.GetDaylightValue()));


// Web Banner stuff
if(ReefAngel.Timer[4].IsTriggered())
{
ReefAngel.Timer[4].Start();
ReefAngel.WebBanner();
}
}

thanx for all the help
Image
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: here is my PDE i think i am close :D

Post by binder »

You've got the fan code in the wrong place. You are checking the temperature stuff for your fans in the setup() which only gets run once at controller startup. That code should be place inside the loop() function which runs continuously (hence the name, loop). Also, you have the function StandardFan that would interfere with anything else you will be doing with the fan ports.

I also cleaned up your condition checks. You don't need the >0 check when you are checking for temps above your max temp because that will always be true. However, you would want that when you are checking your lowest temp to ensure that the temp sensor isn't unplugged or getting a random/bad reading.

Here's what your setup() and loop() should look like:

Code: Select all

void setup()
{
	ReefAngel.Init(); //Initialize controller
	ReefAngel.OverheatShutoffPorts = B00000000;
	ReefAngel.PHMin=529;
	ReefAngel.PHMax=819;

	// Initialize and start the web banner timer
	ReefAngel.LoadWebBanner(pgm_read_word(&(webbanner_items[0])), SIZE(webbanner_items));
	ReefAngel.Timer[4].SetInterval(180); // set interval to 180 seconds
	ReefAngel.Timer[4].Start();
}

void loop()
{
	// Specific functions
	ReefAngel.StandardLights(Port1,8,0,21,0);
	ReefAngel.StandardLights(Port2,8,0,21,0);
	ReefAngel.StandardLights(Port3,8,0,21,0);
	ReefAngel.StandardLights(Port4,7,0,22,0);
	ReefAngel.StandardLights(Port5,7,0,22,0);
	ReefAngel.StandardLights(Port6,7,0,22,0);
	
	// turn on port 7 when temp gets above 77.0 and turn off when temp gets below 74.0
	if (ReefAngel.Params.Temp3 >= 770) ReefAngel.Relay.On(Port7); 
	if (ReefAngel.Params.Temp3 <= 740 && ReefAngel.Params.Temp3 > 0) ReefAngel.Relay.Off(Port7);

	// turn on port 8 when temp gets above 85.0 and turn off when temp gets below 75.0
	if (ReefAngel.Params.Temp2 >= 850) ReefAngel.Relay.On(Port8); 
	if (ReefAngel.Params.Temp2 <= 750 && ReefAngel.Params.Temp2 > 0) ReefAngel.Relay.Off(Port8);

	ReefAngel.PWM.SetActinic(PWMSlope(7,0,22,0,0,100,60,ReefAngel.PWM.GetActinicValue()));
	ReefAngel.PWM.SetDaylight(PWMSlope(8,0,21,0,0,100,60,ReefAngel.PWM.GetDaylightValue())); 

	// Web Banner stuff
	if(ReefAngel.Timer[4].IsTriggered())
	{
		ReefAngel.Timer[4].Start();
		ReefAngel.WebBanner();
	}

	ReefAngel.ShowInterface();
}
curt
Post Reply