Need some help PLEASE!!!

Do you have a question on how to do something.
Ask in here.
Post Reply
treetopflyn
Posts: 88
Joined: Fri Oct 05, 2012 1:58 am

Need some help PLEASE!!!

Post by treetopflyn »

This is a code I would like to use but I would also like to have the wavemaker ports shut down at 9:00pm and turn back on at 7:00am. I can't figure out how to do it with the wizard. This stuff is all new too me so if someone could just change the code below , so I can cut and past, I would be very grateful.

Kevin


#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 <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 = Port1Bit | Port2Bit | Port7Bit | Port8Bit;
ReefAngel.FeedingModePortsE[0] = 0;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port4Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
ReefAngel.WaterChangePortsE[0] = 0;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = 0;
ReefAngel.LightsOnPortsE[0] = 0;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = 0;
ReefAngel.OverheatShutoffPortsE[0] = 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( 889 );


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

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


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

void loop()
{
ReefAngel.StandardATO( Port1,180 );
ReefAngel.WavemakerRandom( Port5,60,220 );
ReefAngel.WavemakerRandom( Port6,60,220 );
ReefAngel.Relay.DelayedOn( Port7,0 );
////// Place your custom code below here


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

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

void DrawCustomMain()
{
int x,y;
char text[10];
// Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 14, ReefAngel.Params,
ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 14, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
pingSerial();

// pH Expansion
ReefAngel.LCD.DrawText( COLOR_MEDIUMSEAGREEN,DefaultBGColor,15,54, "PHE:" );
ReefAngel.LCD.DrawText( COLOR_MEDIUMSEAGREEN,DefaultBGColor,39,54, ReefAngel.Params.PHExp );
pingSerial();

// Main Relay Box
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox( 12, 74, TempRelay );
pingSerial();

// Relay Expansion
TempRelay = ReefAngel.Relay.RelayDataE[0];
TempRelay &= ReefAngel.Relay.RelayMaskOffE[0];
TempRelay |= ReefAngel.Relay.RelayMaskOnE[0];
ReefAngel.LCD.DrawOutletBox( 12, 97, TempRelay );
pingSerial();

// Date and Time
ReefAngel.LCD.DrawDate( 6, 122 );
pingSerial();
}

void DrawCustomGraph()
{
ReefAngel.LCD.DrawGraph( 5, 5 );
}
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Need some help PLEASE!!!

Post by rimai »

Change this:

Code: Select all

ReefAngel.WavemakerRandom( Port5,60,220 );
 ReefAngel.WavemakerRandom( Port6,60,220 );
To this:

Code: Select all

if (hour()>=21 || hour()<7)
{
 ReefAngel.Relay.Off(Port5);
 ReefAngel.Relay.Off(Port6);
}
else
{
 ReefAngel.WavemakerRandom( Port5,60,220 );
 ReefAngel.WavemakerRandom( Port6,60,220 );
}

Roberto.
treetopflyn
Posts: 88
Joined: Fri Oct 05, 2012 1:58 am

Re: Need some help PLEASE!!!

Post by treetopflyn »

Awesome!! Thank you very much
treetopflyn
Posts: 88
Joined: Fri Oct 05, 2012 1:58 am

Re: Need some help PLEASE!!!

Post by treetopflyn »

For some reason I keep getting an error when I try to load this code


The following features were automatically added:
Watchdog Timer
Version Menu

The following features were detected:
Dimming Signal
Wifi Attachment
Custom Main Screen
Relay Expansion Module
PH Expansion Module
Simple Menu
Binary sketch size: 30,918 bytes (of a 32,256 byte maximum)
C:\Program Files\Reef Angel Controller\hardware/tools/avr/bin/avrdude -CC:\Program Files\Reef Angel Controller\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -carduino -P\\.\COM4 -b115200 -D -Uflash:w:C:\Users\Janine\AppData\Local\Temp\build9011814347133553550.tmp\sketch_oct28b.cpp.hex:i

avrdude: Version 6.0, compiled on Apr 6 2012 at 19:29:19
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "C:\Program Files\Reef Angel Controller\hardware/tools/avr/etc/avrdude.conf"

Using Port : \\.\COM4
Using Programmer : arduino
Overriding Baud Rate : 115200
Rebooting Reef Angel Controller
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Recv:
avrdude: stk500_getsync(): not in sync: resp=0x64

avrdude done. Thank you.


CODE

#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 <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 = Port1Bit | Port2Bit | Port7Bit | Port8Bit;
ReefAngel.FeedingModePortsE[0] = 0;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port4Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
ReefAngel.WaterChangePortsE[0] = 0;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = 0;
ReefAngel.LightsOnPortsE[0] = 0;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = 0;
ReefAngel.OverheatShutoffPortsE[0] = 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( 889 );


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

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


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

void loop()
{
ReefAngel.StandardATO( Port1,60 );
if (hour()>=21 || hour()<7)
{
ReefAngel.Relay.Off(Port5);
ReefAngel.Relay.Off(Port6);
}
else
{
ReefAngel.WavemakerRandom( Port5,30,90 );
ReefAngel.WavemakerRandom( Port6,30,90 );
}
ReefAngel.Relay.DelayedOn( Port7,0 );
////// Place your custom code below here


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

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

void DrawCustomMain()
{
int x,y;
char text[10];
// Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 14, ReefAngel.Params,
ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 14, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
pingSerial();

// pH Expansion
ReefAngel.LCD.DrawText( COLOR_MEDIUMSEAGREEN,DefaultBGColor,15,54, "PHE:" );
ReefAngel.LCD.DrawText( COLOR_MEDIUMSEAGREEN,DefaultBGColor,39,54, ReefAngel.Params.PHExp );
pingSerial();

// Main Relay Box
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox( 12, 74, TempRelay );
pingSerial();

// Relay Expansion
TempRelay = ReefAngel.Relay.RelayDataE[0];
TempRelay &= ReefAngel.Relay.RelayMaskOffE[0];
TempRelay |= ReefAngel.Relay.RelayMaskOnE[0];
ReefAngel.LCD.DrawOutletBox( 12, 97, TempRelay );
pingSerial();

// Date and Time
ReefAngel.LCD.DrawDate( 6, 122 );
pingSerial();
}

void DrawCustomGraph()
{
ReefAngel.LCD.DrawGraph( 5, 5 );
}
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Need some help PLEASE!!!

Post by rimai »

Which RA do you have? Standard RA or RA+??
Are you sure it is COM4 that you use to communicate with the controller?
Roberto.
treetopflyn
Posts: 88
Joined: Fri Oct 05, 2012 1:58 am

Re: Need some help PLEASE!!!

Post by treetopflyn »

RA

I am using the same port I have always used
treetopflyn
Posts: 88
Joined: Fri Oct 05, 2012 1:58 am

Re: Need some help PLEASE!!!

Post by treetopflyn »

strange the 10th time I said download it finally took
treetopflyn
Posts: 88
Joined: Fri Oct 05, 2012 1:58 am

Re: Need some help PLEASE!!!

Post by treetopflyn »

OK not for some reason. Port # 6 is not switching on. 5 is doing what it is supposed to but 6 is not coming on. I can turn it on remotely but it is not cycling.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Need some help PLEASE!!!

Post by rimai »

Oh, sorry...
Change this:

Code: Select all

ReefAngel.WavemakerRandom( Port5,30,90 );
ReefAngel.WavemakerRandom( Port6,30,90 );
To this:

Code: Select all

ReefAngel.WavemakerRandom1( Port5,30,90 );
ReefAngel.WavemakerRandom2( Port6,30,90 );
Roberto.
treetopflyn
Posts: 88
Joined: Fri Oct 05, 2012 1:58 am

Re: Need some help PLEASE!!!

Post by treetopflyn »

Thank you.
treetopflyn
Posts: 88
Joined: Fri Oct 05, 2012 1:58 am

Re: Need some help PLEASE!!!

Post by treetopflyn »

damn it now it won't load again
treetopflyn
Posts: 88
Joined: Fri Oct 05, 2012 1:58 am

Re: Need some help PLEASE!!!

Post by treetopflyn »

arghhhhhhhhhhhhh

Rebooting Reef Angel Controller
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Recv: . [7f]
avrdude: stk500_getsync(): not in sync: resp=0x7f

avrdude done. Thank you.
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Need some help PLEASE!!!

Post by DrewPalmer04 »

deep breath and relax. There is a bit of a learning curve with the RA...BUT once you get past it...this unit is AMAZING!
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Need some help PLEASE!!!

Post by lnevo »

Sometimes you need to plug/unplug the ttl cable and make sure too its on the correct pins...
treetopflyn
Posts: 88
Joined: Fri Oct 05, 2012 1:58 am

Re: Need some help PLEASE!!!

Post by treetopflyn »

done that several times already
treetopflyn
Posts: 88
Joined: Fri Oct 05, 2012 1:58 am

Need some help PLEASE!!!

Post by treetopflyn »

Got it thanks again
Post Reply