Page 1 of 1

second temp probe not displaying on T2

Posted: Sat Sep 22, 2012 10:03 pm
by riggeek
Need some help with second temp probe not displaying temp. I have swapped both probes to between port 1 and port 2 the new temp probe does not show temp now matter where it is plugged in.

Here is the 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 <ReefAngel.h>

// Initialize Buzzer variables
byte buzzer=0;
byte overheatflag=0;
byte atoflag=0;

////// 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 | Port5Bit | Port6Bit | Port8Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port5Bit | Port6Bit | Port8Bit;



// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port3Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port3Bit | Port4Bit | Port7Bit;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;


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

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


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

void loop()
{
ReefAngel.StandardATO( Port1 );
ReefAngel.DosingPumpRepeat1( Port2 );
ReefAngel.DayLights( Port3 );
ReefAngel.Relay.Set( Port4, !ReefAngel.Relay.Status( Port3 ) );
ReefAngel.WavemakerRandom1(Port5,20,60); // Turn Port5 on/off random cycles that lasts from 20 to 60 secs
ReefAngel.WavemakerRandom2(Port6,20,60); // Turn Port6 on/off random cycles that lasts from 20 to 60 secs
// Port 5 and 6 are not synchronized.
// They work independent of each other at random times.
ReefAngel.StandardHeater( Port7 );
overheatflag = InternalMemory.read( Overheat_Exceed_Flag );
atoflag = InternalMemory.read( ATO_Exceed_Flag );
buzzer = overheatflag + atoflag;
if ( buzzer >= 1 ) buzzer = 100;
ReefAngel.PWM.SetDaylight( buzzer );
ReefAngel.PWM.SetActinic( buzzer );

////// Place your custom code below here


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

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

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

// Salinity
ReefAngel.LCD.DrawText( COLOR_DARKKHAKI,DefaultBGColor,15,66, "SAL:" );
ReefAngel.LCD.DrawText( COLOR_DARKKHAKI,DefaultBGColor,39,66, ReefAngel.Params.Salinity );
pingSerial();

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

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

void DrawCustomGraph()
{
}

Re: second temp probe not displaying on T2

Posted: Sat Sep 22, 2012 10:06 pm
by rimai
Did you reboot the controller?

Re: second temp probe not displaying on T2

Posted: Sat Sep 22, 2012 10:31 pm
by riggeek
Just did the reboot. that got it working. T1 and T2 swapped on the reboot. How does the controller determine which one is T1 and T2?

Re: second temp probe not displaying on T2

Posted: Sun Sep 23, 2012 8:26 am
by rimai
A serial number is laser inscribed on manufacturing and determined by the order they are manufactured.
So T1 will be the oldest to be manufactured and T3 would be the newest.