Multiple water level module status
Multiple water level module status
Any updates ?
Re: Multiple water level module status
I've got a couple, but the libraries are not finalized yet.
The calibration code I have isn't working right.
The calibration code I have isn't working right.
Roberto.
Re: Multiple water level module status
let me know. Going on vacation soon and will need to set up the ATO
Re: Multiple water level module status
I'll post my modified code after I get home tonight. It calibrates all 5 ports (single at port 0, and the multi on ports 1 - 4) and seems to be working for me. I'm only using port 1 at the moment and it's calibrating and reading correctly.rimai wrote:I've got a couple, but the libraries are not finalized yet.
The calibration code I have isn't working right.
Re: Multiple water level module status
Here's what I used:
Code: Select all
#ifdef WATERLEVELEXPANSION
void ReefAngelClass::SetupCalibrateWaterLevel()
{
bool bOKSel = false;
bool bSave = false;
bool bDone = false;
bool bDrawButtons = true;
unsigned int iO[10] = {0,0,0,0,0,0,0,0,0,0};
unsigned int iCal[2] = {0,100};
byte offset = 65;
// draw labels
ClearScreen(DefaultBGColor);
for (int b=0;b<10;b++)
{
if (b==10 && !bSave) break;
bOKSel=false;
bSave=false;
bDone = false;
bDrawButtons = true;
LCD.DrawText(DefaultFGColor, DefaultBGColor, MENU_START_COL, MENU_START_ROW, "Calibrate Water Level");
char port[10] = "Port: ";
itoa(b/2,port,10);
LCD.DrawText(DefaultFGColor, DefaultBGColor, MENU_START_COL, MENU_START_ROW+16, port);
char text[10] = "";
itoa(iCal[b%2],text,10);
strcat(text , " % ");
LCD.DrawText(DefaultFGColor, DefaultBGColor, MENU_START_COL, MENU_START_ROW*5, text);
do
{
#if defined WDT || defined WDT_FORCE
wdt_reset();
#endif // defined WDT || defined WDT_FORCE
iO[b]=0;
for (int a=0;a<15;a++) {
iO[b] += WaterLevel.Read(b/2);
}
iO[b]/=15;
LCD.DrawCalibrate(iO[b], MENU_START_COL + offset, MENU_START_ROW*5);
if ( bDrawButtons )
{
if ( bOKSel )
{
LCD.DrawOK(true);
LCD.DrawCancel(false);
}
else
{
LCD.DrawOK(false);
LCD.DrawCancel(true);
}
bDrawButtons = false;
}
if ( Joystick.IsUp() || Joystick.IsDown() || Joystick.IsRight() || Joystick.IsLeft() )
{
// toggle the selection
bOKSel = !bOKSel;
bDrawButtons = true;
}
if ( Joystick.IsButtonPressed() )
{
bDone = true;
if ( bOKSel )
{
bSave = true;
}
}
} while ( ! bDone );
}
ClearScreen(DefaultBGColor);
if ( bSave )
{
// save WaterLevelMin & WaterLevelMax to memory
InternalMemory.WaterLevelMin_write(iO[0]);
InternalMemory.WaterLevelMax_write(iO[1]);
InternalMemory.WaterLevel1Min_write(iO[2]);
InternalMemory.WaterLevel1Max_write(iO[3]);
InternalMemory.WaterLevel2Min_write(iO[4]);
InternalMemory.WaterLevel2Max_write(iO[5]);
InternalMemory.WaterLevel3Min_write(iO[6]);
InternalMemory.WaterLevel3Max_write(iO[7]);
InternalMemory.WaterLevel4Min_write(iO[8]);
InternalMemory.WaterLevel4Max_write(iO[9]);
}
}
#endif // WATERLEVELEXPANSION
Re: Multiple water level module status
Any updates? Is it possible to run two single modules together?
Re: Multiple water level module status
These module is available in the web store
It's a 4 port module.
It's a 4 port module.
Roberto.
Re: Multiple water level module status
I have one single module and I just placed an order for an additional single module before seeing this thread :/
Sent from my Nexus 5 using Tapatalk
Sent from my Nexus 5 using Tapatalk