- Code: Select all
#include <RT_PWM.h>
#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>
#include <avr/pgmspace.h>
byte RoyalBluePWMValue=0;
byte WhitePWMValue=0;
byte BluePWMValue=0;
byte PinkPWMValue=0;
////// Place global variable code below here
prog_char menu0_label[] PROGMEM = "Feeding";
prog_char menu1_label[] PROGMEM = "Water Change";
prog_char menu2_label[] PROGMEM = "ATO Clear";
prog_char menu3_label[] PROGMEM = "Overheat Clear";
prog_char menu4_label[] PROGMEM = "PH Calibration";
prog_char menu5_label[] PROGMEM = "Date / Time";
prog_char menu6_label[] PROGMEM = "Version";
prog_char menu7_label[] PROGMEM = "Lighting";
PROGMEM const char *menu_items[] = {
menu0_label, menu1_label, menu2_label,
menu3_label, menu4_label, menu5_label,
menu6_label,menu7_label//, menu7_label, menu8_label
};
void MenuEntry1()
{
ReefAngel.FeedingModeStart();
}
void MenuEntry2()
{
ReefAngel.WaterChangeModeStart();
}
void MenuEntry3()
{
ReefAngel.ATOClear();
ReefAngel.DisplayMenuEntry("Clear ATO Timeout");
}
void MenuEntry4()
{
ReefAngel.OverheatClear();
ReefAngel.DisplayMenuEntry("Clear Overheat");
}
void MenuEntry5()
{
ReefAngel.SetupCalibratePH();
ReefAngel.DisplayedMenu = ALT_SCREEN_MODE;
}
void MenuEntry6()
{
ReefAngel.SetupDateTime();
ReefAngel.DisplayedMenu = ALT_SCREEN_MODE;
}
void MenuEntry7()
{
ReefAngel.DisplayVersion();
}
void MenuEntry8()
{
ReefAngel.PWMSetPercent(byte p);
}
////// Place global variable code above here
void setup()
{
// This must be the first line
ReefAngel.Init(); //Initialize controller
ReefAngel.InitMenu(pgm_read_word(&(menu_items[0])),SIZE(menu_items));
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = Port5Bit | Port6Bit | Port8Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port5Bit | Port6Bit | Port8Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port3Bit | Port4Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port7Bit;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 850 );
// 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()
{
ReefAngel.StandardATO( Port1,1800 );
ReefAngel.StandardLights( Port3,7,0,22,0 );
ReefAngel.StandardLights( Port4,11,0,23,0 );
ReefAngel.StandardHeater( Port7,780,790 );
RoyalBluePWMValue= PWMSlope(7,0,23,0,0,100,90,RoyalBluePWMValue) ;
WhitePWMValue=PWMParabola(10,0,22,0,0,100,WhitePWMValue) ;
BluePWMValue=PWMParabola(8,30,20,0,0,100,BluePWMValue) ;
PinkPWMValue=PWMSlope(7,30,22,30,0,100,90,PinkPWMValue) ;
CheckCloud();
ReefAngel.PWM.SetChannel( 0, RoyalBluePWMValue);
ReefAngel.PWM.SetChannel( 1, WhitePWMValue );
ReefAngel.PWM.SetChannel( 2, BluePWMValue );
ReefAngel.PWM.SetChannel( 3, PinkPWMValue );
////// Place your custom code below here
// This should always be the last line
ReefAngel.Portal( "Bruz4023" );
ReefAngel.ShowInterface();
}
Help with Custom Menus
16 posts
• Page 1 of 2 • 1, 2
So I am having successes with the custom menus but what i want is an option to turn my lights on at anytime to full brightness. it says that the class PWMSetPercent doesnt exist but you had said in the manual that it does. what am I missing
|
|
Is it for the standard dimming channels or expansion module?
Roberto.
|
|
Expansion Module i am using channels 0-3
|
|
Try this:
Roberto.
|
|
So That logically makes sense to me but i got an error " Clouds2:91: error: 'class RA_PWMClass' has no member named 'GetChannelOverrideValue' " Thats the same problem I was having Another question in the code you gave I understand the 0, 1, 2 those correspond to the channels but what is the 255? and why cant you just force it to go full brightness why do you need the if and else statements? |
|
If the lights are overriden, put them back to normal otherwise override them.
255 is the default (non overriden value) Sounds like you have older libraries. Try installing the latest versionx |
|
Yeah, if you override them to 100%, you would need a way to put them back to normal mode, right?
That's why I made the if...else statement or you would be forever in 100% ![]() Roberto.
|
|
That makes perfect sense! so I just uninstalled and re installed the reef controller program. no luck it is giving me the same issue.
What are the eagle files? i haven't figured out what they are or where they go? I am kinda assuming that missing them is my problem. |
|
What do you get when you do to Tools->Reef Angel Libraries Version?
Eagle files are the files to create the PCB. You don't need them. http://www.cadsoftusa.com/ Roberto.
|
|
O ok that looks cool I will check tonight when I get home What version should I have?
I did delete all files and re install the RA arduino program, so i should have the most up to date! |
|
16 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 2 guests