New Head Unit....
Re: New Head Unit....
I would like a secondary display just for stauts-check (no touchscreen or control). The standard one is too small and has to many wire...
Re: New Head Unit....
Even if you want to wait, you would still need to purchase the base RA. It will not work without the base unit.
It is going to be offered as an expansion module, but I have no dates to be released yet.
It is going to be offered as an expansion module, but I have no dates to be released yet.
Roberto.
Re: New Head Unit....
You could use the iPhone or Android appdhave wrote:I would like a secondary display just for stauts-check (no touchscreen or control). The standard one is too small and has to many wire...
They are awesome for that purpose. I rarely look at my head unit screen anymore. Thanks Curt (binder), John (wolfador) and Dave (dmolton)!!!
Roberto.
-
- Posts: 149
- Joined: Tue Nov 01, 2011 11:05 am
Re: New Head Unit....
Didn't realize it was gnna be an expansion
Re: New Head Unit....
This will most likely be something to be beta tested mid next year if everything goes well with prototyping.
Roberto.
Re: New Head Unit....
So, just a question. It's mid next year already!! Um... Do ya need beta testers?
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL
Re: New Head Unit....
Do you have anything saved from when you were in prototype testing? Parts list? Anything? I would love to mess with this idea.
Re: New Head Unit....
I thought Id ask in this thread rather than start another. Is this going to become a reality or has it been shelved in the too hard basket? Id love a 5" Touchscreen display on the front of my tank and I notice people are starting to get it going on home made solutions here
http://www.masa.asn.au/phpBB3/viewtopic ... 9&t=244697
http://www.masa.asn.au/phpBB3/viewtopic ... 9&t=244697
Re: New Head Unit....
I stopped the development of this unit
You can most certainly use any Arduino shield and connect to RA to use it as a remote display though.
You can most certainly use any Arduino shield and connect to RA to use it as a remote display though.
Roberto.
Re: New Head Unit....
Thats a bummer, it would have been really good to have touch buttons to control the expansion relays.
Sadly, I dont really have the knowledge to set forth on my own to make this myself, otherwise I would be there.
Any hints or howtos would be awesome
Sadly, I dont really have the knowledge to set forth on my own to make this myself, otherwise I would be there.
Any hints or howtos would be awesome
- jsclownfish
- Posts: 378
- Joined: Mon Oct 24, 2011 7:52 pm
- Location: Saint Louis
Re: New Head Unit....
Has anyone looked at these?
http://www.gizmag.com/arduinolcd-arduin ... een/24381/
I'm thinking of getting one to try with the RA. It would be nice to have a quick touchscreen for toggling the relays manually amongst other things.
Jon
http://www.gizmag.com/arduinolcd-arduin ... een/24381/
I'm thinking of getting one to try with the RA. It would be nice to have a quick touchscreen for toggling the relays manually amongst other things.
Jon
Re: New Head Unit....
Very cool.
Thanks for sharing
I did test one of the EarthLCD in the past and they performed ok.
I'm sure this one is much easier to integrate as it has the Arduino board form factor.
Thanks for sharing
I did test one of the EarthLCD in the past and they performed ok.
I'm sure this one is much easier to integrate as it has the Arduino board form factor.
Roberto.
- jsclownfish
- Posts: 378
- Joined: Mon Oct 24, 2011 7:52 pm
- Location: Saint Louis
Re: New Head Unit....
I ordered one today. I'll post updates when it arrives.
Jon
Jon
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL
Re: New Head Unit....
Please do!
Re: New Head Unit....
How difficult would it be for someone with no arduino experience to get this unit working?
I'm planning to eventually (not sure when) pick up an arduino starter kit to see how it all works.
I do have some college level education in computer science/programming.
I'm planning to eventually (not sure when) pick up an arduino starter kit to see how it all works.
I do have some college level education in computer science/programming.
- jsclownfish
- Posts: 378
- Joined: Mon Oct 24, 2011 7:52 pm
- Location: Saint Louis
Re: New Head Unit....
Hi all,
Just a quick note to give you an update on this LCD touchscreen unit. I received it about a week ago and I am still trying to make some progress on the basics of the system. It is a little clunky in using the predesigned macros for things like buttons and slide bars. I wanted to test it out by simply making an on/off set of buttons for the relays. I'm still trying to get that to work. I tested about 6 sample programs and I can no longer get a program to upload. The tech service folks have been responsive, but not able to solve this issue. I was told they are taking a lot of calls on this unit, so it may still need some fine tuning before it is really more robust. I'll follow-up again one I have some thing to show you.
-Jon
Just a quick note to give you an update on this LCD touchscreen unit. I received it about a week ago and I am still trying to make some progress on the basics of the system. It is a little clunky in using the predesigned macros for things like buttons and slide bars. I wanted to test it out by simply making an on/off set of buttons for the relays. I'm still trying to get that to work. I tested about 6 sample programs and I can no longer get a program to upload. The tech service folks have been responsive, but not able to solve this issue. I was told they are taking a lot of calls on this unit, so it may still need some fine tuning before it is really more robust. I'll follow-up again one I have some thing to show you.
-Jon
Re: New Head Unit....
Jon,
There was a thread on reef central where they programmed their own UI. Though different LCD touchscreen with different libraries I think.
How easy was it to get it hooked up to the RA board?
Thanks for the update.
There was a thread on reef central where they programmed their own UI. Though different LCD touchscreen with different libraries I think.
How easy was it to get it hooked up to the RA board?
Thanks for the update.
- jsclownfish
- Posts: 378
- Joined: Mon Oct 24, 2011 7:52 pm
- Location: Saint Louis
Re: New Head Unit....
The communication should be straight forward over I2C. I already have my old RA set up as a secondary monitor,
http://forum.reefangel.com/viewtopic.php?f=11&t=923, I just thought this would be more fun an interactive. In theory the attached arduino board and macros associated with this LCD should work nicely. The system just isn't very robust how they have them working together (Arduino code and EarthSEMPL macros). It's a new product though so I kind of expected a few issues.
-Jon
http://forum.reefangel.com/viewtopic.php?f=11&t=923, I just thought this would be more fun an interactive. In theory the attached arduino board and macros associated with this LCD should work nicely. The system just isn't very robust how they have them working together (Arduino code and EarthSEMPL macros). It's a new product though so I kind of expected a few issues.
-Jon
- jsclownfish
- Posts: 378
- Joined: Mon Oct 24, 2011 7:52 pm
- Location: Saint Louis
Re: New Head Unit....
So, a quick update on the ezLCD... I haven't had a lot of time to play with it, but I think it can work depending on what you want to do. I am by no means a programmer, so I'm sure someone more adept could make it do lots of things. I've just worked on having it display data from the main and it seems to be working. I haven't had really tried to make the touchscreen communicate back. I've found the prepared widgets (buttons, sliders, etc) are a bit wonky to work with.
Anyway, here is what it looks like when you order it.... and here is my first demo screen hooked up to my RA... I'll be playing with some buttons and stuff soon.
-Jon
Anyway, here is what it looks like when you order it.... and here is my first demo screen hooked up to my RA... I'll be playing with some buttons and stuff soon.
-Jon
Re: New Head Unit....
How are you attaching that to the head unit? As an expansion through USB? or TTL?
- jsclownfish
- Posts: 378
- Joined: Mon Oct 24, 2011 7:52 pm
- Location: Saint Louis
Re: New Head Unit....
I use an I2C connection with the USB. I have a USB cable with the lines split out on one end. I then connect it to the Arduino board on the ArLCD. The I2C needs a couple pull up resistors so I have it on a small breadboard for testing.
-Jon
-Jon
-
- Posts: 289
- Joined: Wed May 16, 2012 9:52 pm
Re: New Head Unit....
I know I have been eyeballing this Touchscreen LCD
http://www.sainsmart.com/arduino-compat ... -2560.html
There is a sheild to fit it directly to a Arduino Mega 2560 as well. I think The Display with the sheild can be found on ebay for about $30
It's been calling my name...
Nick
http://www.sainsmart.com/arduino-compat ... -2560.html
There is a sheild to fit it directly to a Arduino Mega 2560 as well. I think The Display with the sheild can be found on ebay for about $30
It's been calling my name...
Nick
180G FOWLR
20GH QT#1
29G QT#2
20GH QT#1
29G QT#2
Re: New Head Unit....
Just be careful with level shift....
That board does not have one.
I'm 99% confident that the LCD module is 3.3V.
I use similar screens and they are all 3.3V. If your Mega is 3.3V, then you are fine.
That board does not have one.
I'm 99% confident that the LCD module is 3.3V.
I use similar screens and they are all 3.3V. If your Mega is 3.3V, then you are fine.
Roberto.
-
- Posts: 289
- Joined: Wed May 16, 2012 9:52 pm
Re: New Head Unit....
Here is the same Display on ebay with the sheild and even a Sainsmart clone of an Arduino 2560 Mega all for about $50
I came so very very close to purchasing this package.
http://www.ebay.com/itm/SainSmart-Mega2 ... 3f1a0ab450
I did buy one but with the more common blue 2 line LCD with the up/down/L/R/Enter buttons. Cant remember the LCD model number but it's a common one used in Arduino projects. Should arrive any day now.
Nick
I came so very very close to purchasing this package.
http://www.ebay.com/itm/SainSmart-Mega2 ... 3f1a0ab450
I did buy one but with the more common blue 2 line LCD with the up/down/L/R/Enter buttons. Cant remember the LCD model number but it's a common one used in Arduino projects. Should arrive any day now.
Nick
180G FOWLR
20GH QT#1
29G QT#2
20GH QT#1
29G QT#2
- jsclownfish
- Posts: 378
- Joined: Mon Oct 24, 2011 7:52 pm
- Location: Saint Louis
Re: New Head Unit....
I spent the good part of the weekend working on this "ezLCD" system to try and accomplish three things:
1) receiving info from the main to display on a bigger LCD
2) control the relays from the touch screen
3) alternate between screens to accomplish 1&2
Seems like it would be straigthforward from the system libraries and the "widgets", but I had a tough time getting them to work appropriately and had to litter the code with delay steps to allow things to display correctly. This causes things to show correctly, but they don't always load as you would expect and it requires you to hold buttons 2 or 3 seconds before you see the activity. I'm guessing this has to do with the speed the LCD communicates with the Arduino board. I also had to add back in code for text display, clock, etc that is already in the RA LCD library but not in this LCD. Nevertheless, I did eventually get it to work , but I wouldn't say it is robust. Here is a video link of how it looks....(nevermind the football in the background, I was multitasking )
[youtube]http://www.youtube.com/watch?v=6O-KktgTzD8[/youtube]
If you're curious, here is what the code I put together looks like for the ezLCD. I'll admit I have no idea why some of the delays work, I just started adding them in places until it displayed correctly.
and the demo code on the RA unit I used to test it. I ony had the main temp probe connected to see that it updated correctly.
-jon
1) receiving info from the main to display on a bigger LCD
2) control the relays from the touch screen
3) alternate between screens to accomplish 1&2
Seems like it would be straigthforward from the system libraries and the "widgets", but I had a tough time getting them to work appropriately and had to litter the code with delay steps to allow things to display correctly. This causes things to show correctly, but they don't always load as you would expect and it requires you to hold buttons 2 or 3 seconds before you see the activity. I'm guessing this has to do with the speed the LCD communicates with the Arduino board. I also had to add back in code for text display, clock, etc that is already in the RA LCD library but not in this LCD. Nevertheless, I did eventually get it to work , but I wouldn't say it is robust. Here is a video link of how it looks....(nevermind the football in the background, I was multitasking )
[youtube]http://www.youtube.com/watch?v=6O-KktgTzD8[/youtube]
If you're curious, here is what the code I put together looks like for the ezLCD. I'll admit I have no idea why some of the delays work, I just started adding them in places until it displayed correctly.
Code: Select all
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <ezLCD.h>
#include <SoftwareSerial.h>
EzLCD3_SW lcd( 10, 11 );
volatile boolean ezLCDInt = false; // flag to indicate interrupt
//screen set-up
#define NumScreens 4
int ScreenID=0;
//define for data over I2C
int maintemp=800;
int roomtemp=780;
int sumptemp=780;
int ph=700;
int moonlight=0;
byte TempRelay =15;
byte TempRelay2=15;
int wavetime=0;
int wavetime2=0;
int flow0=0;
int flow1=0;
int flow2=0;
int wmaker2;
byte mhour;
byte mminute;
byte msecond;
byte mday;
byte mmonth;
int myear = 2012;
byte Overflow;
byte Reservoir;
byte LATO;
byte HATO;
byte level;
byte atos;
//defines for sending relay data
byte lcdtype =0;
byte lcdrelay =0;
byte TouchOut[3];
//defines for button selection
int rate =0;
int selected = 0;
int prevSelected = 0;
int backcheck = 5;
void setup()
{
Wire.begin(7);
Wire.onRequest(requestEvent);
Wire.onReceive(receiveEvent);
setTime(19,59,0,6,3,12);
lcd.begin( EZM_BAUD_RATE );
lcd.cls(BLACK);
// delay(1000);
//lcd.theme( id, embossDkColor, embossLtColor, textColor0, textColor1, textColorDisabled,
//color0, color1, colorDisabled, commonBkColor, fontw )
lcd.theme( 1, 9, 3, 0, 0, 0, 8, 9, 8, 1, 1 );
lcd.theme( 2, 5, 20, 3, 3, 3, 4, 5, 4, 2, 1 );
lcd.theme( 3, 13, 20, 3, 3, 3, 12, 13, 12, 2, 1 );
lcd.theme( 4, 7, 20, 0, 0, 0, 6, 7, 6, 2, 1 );
attachInterrupt(0, ezLCDevent, LOW);
}
void loop()
{
//start up opttion screen
lcd.cls( 0 );
delay(1000);
lcd.fontw( 1, "sans24" );
lcd.string( 51, "STATUS" ); // stringId 1
lcd.string( 52, "RELAY1"); // stringId 2
lcd.string( 53, "RELAY2"); // stringId 2
lcd.button( 51, 10, 40, 100, 100, 1, 0,0, 1, 51 );
lcd.button( 52, 110, 40, 100, 100, 1, 0,0, 1, 52 );
lcd.button( 53, 210, 40, 100, 100, 1, 0,0, 1, 53 );
delay(1000);
if( ezLCDInt )
{
ezLCDInt = false;
if( lcd.isPressed(51) ) // if Button 1 is pressed:
ScreenID = 1;
if( lcd.isPressed(52) ) // if Button 2 was pressed:
ScreenID = 2;
if( lcd.isPressed(53) ) // if Button 2 was pressed:
ScreenID = 3;
}
if (ScreenID<0) ScreenID=NumScreens;
if (ScreenID>=NumScreens) ScreenID=0;
lcd.waitTouch();
switch (ScreenID)
{
case 1:
lcd.cls(BLACK);
delay(1000);
do
{
Wire.onReceive(receiveEvent);
lcd.fontw( 1, "sans24" );
lcd.string( 54, "BACK" ); // stringId 1
lcd.button( 54, 200, 1, 50, 50, 1, 0, 0, 4, 54 );
delay (1000);
if( ezLCDInt )
{
ezLCDInt = false;
if( lcd.isPressed(54) ) // if Button 1 is pressed:
backcheck= 54;
}
lcd.color(WHITE);
DrawText(6,10,5,"Main Temp");
DrawSingleMonitor(3,maintemp,150,5,10);
delay(100);
DrawText(8,10,30,"Room Temp");
DrawSingleMonitor(3,roomtemp,150,30,10);
delay(100);
DrawText(10,10,55,"Sump Temp");
DrawSingleMonitor(3,sumptemp,150,55,10);
delay(100);
DrawText(12,10,80,"pH");
DrawSingleMonitor(3,ph,150,80,100);
delay(100);
DrawText(14,10,105,"Overflow");
DrawSingleMonitor(3,flow0,150,105,1);
delay(100);
DrawText(16,10,130,"Skimmer");
DrawSingleMonitor(3,flow1,150,130,1);
delay(100);
DrawText(7,10,155,"Phosban");
DrawSingleMonitor(4,flow2,150,155,1);
delay(100);
DrawSingleMonitor(4,backcheck,150,180,1);
delay(100);
lcd.image("logo200.gif",220,80);
DrawDate(4,6,205);
delay(100);
} while (backcheck != 54);
backcheck = 0;
ScreenID=0;
break;
case 2:
lcd.cls(0);
delay(1000);
lcd.fontw( 1, "sans24" );
do
{
// delay (100);
DrawText(3,1,1,"Relay #1");
DrawSwitch(5,40,1,2,3);
DrawSwitch(5,90,4,5,6);
DrawSwitch(5,140,7,8,9);
DrawSwitch(5,190,10,11,12);
DrawSwitch(160,40,13,14,15);
DrawSwitch(160,90,16,17,18);
DrawSwitch(160,140,19,20,21);
DrawSwitch(160,190,22,23,24);
lcd.string( 25, "BACK" ); // stringId 1
lcd.button( 25, 200, 1, 50, 40, 1, 0, 0, 4, 25 );
for(int i=1; i <= 25; i++)
{
boolean checked = lcd.isPressed(i);
if(checked) // if Button 1 is checked
selected = i; // store the selected widget
}
if(selected != prevSelected)
{
prevSelected = selected;
}
if (selected < 4)
{
lcdrelay=1;
if (selected == 1) lcdtype = 0;
else if (selected == 2) lcdtype = 1;
else if (selected == 3) lcdtype = 2;
}
else if (selected >3 && selected < 7)
{
lcdrelay=2;
if (selected == 4) lcdtype = 0;
else if (selected == 5) lcdtype = 1;
else if (selected == 6) lcdtype = 2;
}
else if (selected >6 && selected < 10)
{
lcdrelay=3;
if (selected == 7) lcdtype = 0;
else if (selected == 8) lcdtype = 1;
else if (selected == 9) lcdtype = 2;
}
else if (selected >9 && selected < 13)
{
lcdrelay=4;
if (selected == 10) lcdtype = 0;
else if (selected == 11) lcdtype = 1;
else if (selected == 12) lcdtype = 2;
}
else if (selected >12 && selected < 16)
{
lcdrelay=5;
if (selected == 13) lcdtype = 0;
else if (selected == 14) lcdtype = 1;
else if (selected == 15) lcdtype = 2;
}
else if (selected >15 && selected < 19)
{
lcdrelay=6;
if (selected == 16) lcdtype = 0;
else if (selected == 17) lcdtype = 1;
else if (selected == 18) lcdtype = 2;
}
else if (selected >18 && selected < 22)
{
lcdrelay=7;
if (selected == 19) lcdtype = 0;
else if (selected == 20) lcdtype = 1;
else if (selected == 21) lcdtype = 2;
}
else if (selected >21 && selected < 25)
{
lcdrelay=8;
if (selected == 22) lcdtype = 0;
else if (selected == 23) lcdtype = 1;
else if (selected == 24) lcdtype = 2;
}
TouchOut[1]=lcdtype;
TouchOut[2]=lcdrelay;
} while (selected != 25);
ScreenID=0;
selected=0;
break;
case 3:
lcd.cls(0);
delay(1000);
lcd.fontw( 1, "sans24" );
do
{
// delay (100);
DrawText(3,1,1,"Relay #2");
DrawSwitch(5,40,26,27,28);
DrawSwitch(5,90,29,30,31);
DrawSwitch(5,140,32,33,34);
DrawSwitch(5,190,35,36,37);
DrawSwitch(160,40,38,39,40);
DrawSwitch(160,90,41,42,43);
DrawSwitch(160,140,44,45,46);
DrawSwitch(160,190,47,48,49);
lcd.string( 50, "BACK" ); // stringId 1
lcd.button( 50, 200, 1, 50, 40, 1, 0, 0, 4, 50 );
for(int i=26; i <= 50; i++)
{
boolean checked = lcd.isPressed(i);
if(checked) // if Button 1 is checked
selected = i; // store the selected widget
}
if(selected != prevSelected)
{
prevSelected = selected;
}
if (selected >25 && selected < 29)
{
lcdrelay=9;
if (selected == 26) lcdtype = 0;
else if (selected == 27) lcdtype = 1;
else if (selected == 28) lcdtype = 2;
}
else if (selected >28 && selected < 32)
{
lcdrelay=10;
if (selected == 29) lcdtype = 0;
else if (selected ==30) lcdtype = 1;
else if (selected == 31) lcdtype = 2;
}
else if (selected >31 && selected < 35)
{
lcdrelay=11;
if (selected == 32) lcdtype = 0;
else if (selected == 33) lcdtype = 1;
else if (selected == 34) lcdtype = 2;
}
else if (selected >34 && selected < 38)
{
lcdrelay=12;
if (selected == 35) lcdtype = 0;
else if (selected == 36) lcdtype = 1;
else if (selected == 37) lcdtype = 2;
}
else if (selected >37 && selected < 41)
{
lcdrelay=13;
if (selected == 38) lcdtype = 0;
else if (selected == 39) lcdtype = 1;
else if (selected == 40) lcdtype = 2;
}
else if (selected >40 && selected < 44)
{
lcdrelay=14;
if (selected == 41) lcdtype = 0;
else if (selected == 42) lcdtype = 1;
else if (selected == 43) lcdtype = 2;
}
else if (selected >43 && selected < 47)
{
lcdrelay=15;
if (selected == 44) lcdtype = 0;
else if (selected == 45) lcdtype = 1;
else if (selected == 46) lcdtype = 2;
}
else if (selected >46 && selected < 50)
{
lcdrelay=16;
if (selected == 47) lcdtype = 0;
else if (selected == 48) lcdtype = 1;
else if (selected == 49) lcdtype = 2;
}
TouchOut[1]=lcdtype;
TouchOut[2]=lcdrelay;
} while (selected != 50);
ScreenID=0;
selected=0;
break;
}
}
void receiveEvent(int howMany)
{
if (howMany==5) // Our custom protocol is 13 bytes
{
byte cmd1,cmd2,cmd3,cmd4,cmd5;
cmd1=Wire.read();
cmd2=Wire.read();
cmd3=Wire.read();
cmd4=Wire.read();
cmd5=Wire.read();
if (cmd1=='$' && cmd2=='$' && cmd3=='$') // the first 3 bytes of the custom protocol are $$$ to ensure it's coming from RA
{
maintemp=(cmd4<<8)+cmd5;
}
}
}
void requestEvent() {
Wire.write(TouchOut, sizeof(TouchOut));
}
void ConvertNumToString(char* string, int num, byte decimal)
{
char temptxt[3];
int Temp = num;
if (Temp==0xFFFF) Temp=0;
itoa(Temp/decimal,string,10);
if (decimal>1)
{
itoa(Temp%decimal,temptxt,10);
strcat(string , ".");
if (Temp%decimal<10 && decimal==100) strcat(string , "0");
strcat(string , temptxt);
}
}
void DrawSingleMonitor(byte c,int Temp, byte x, byte y, byte decimal)
{
lcd.xy(x,y);
char text[7];
if ( Temp == 0xFFFF ) Temp = 0;
if (( Temp == 0 ) && ( decimal > 1 ))
{
strcpy(text, "Error");
}
else
{
ConvertNumToString(text, Temp, decimal);
}
lcd.color(BLACK);
lcd.rect(x,y,50,20);
lcd.fill(TRUE);
lcd.string(1,text);
lcd.color(c);
lcd.printStringId(1,10);
}
void DrawText(byte c, byte x, byte y, char* string)
{
lcd.color(c);
lcd.xy(x,y);
lcd.string(9,string);
lcd.printStringId(9,10);
}
void DrawSwitch(byte x, byte y, byte a, byte b, byte c)
{
lcd.fontw( 1, "sans24" );
lcd.color(WHITE);
lcd.theme( 1, 9, 3, 0, 0, 0, 8, 9, 8, 1, 1 );
lcd.theme( 2, 5, 20, 3, 3, 3, 4, 4, 4, 2, 1 );
lcd.theme( 3, 5, 20, 3, 3, 3, 13, 13, 13, 2, 1 );
delay(500);
lcd.string( 1, "OFF" ); // stringId 1
lcd.string( 2, "ON" ); // stringId 2
lcd.string( 3, "AUTO" ); // stringId 1
lcd.button( a, x, y, 50, 50, 1, 0, 0, 1, 1 );
lcd.button( b, x+50, y, 50, 50, 1, 0, 0, 2, 2 );
lcd.button( c, x+100, y, 50, 50, 1, 0, 0, 3, 3 );
}
void DrawDate(byte c, byte x, byte y)
{
//byte iTimeHourOffset=0;
char text[21];
char temp[]=" ";
strcpy(text,"");
itoa(month(),temp,10);
if (temp[1]==0) strcat(text,"0");
strcat(text,temp);
strcat(text,"/");
itoa(day(),temp,10);
if (temp[1]==0) strcat(text,"0");
strcat(text,temp);
strcat(text,"/");
itoa(year()-2000,temp,10);
if (temp[1]==0) strcat(text,"0");
strcat(text,temp);
strcat(text," ");
//if (iTimeHour>12) iTimeHourOffset=12;
itoa(hourFormat12(),temp,10);
if (temp[1]==0) strcat(text,"0");
strcat(text,temp);
strcat(text,":");
itoa(minute(),temp,10);
if (temp[1]==0) strcat(text,"0");
strcat(text,temp);
strcat(text,":");
itoa(second(),temp,10);
if (temp[1]==0) strcat(text,"0");
strcat(text,temp);
if (isAM())
{
strcat(text," AM");
}
else
{
strcat(text," PM");
}
lcd.color(BLACK);
lcd.rect(x,y,200,20);
lcd.fill(TRUE);
lcd.string(1,text);
lcd.color(c);
lcd.printStringId(1,10);
}
void ezLCDevent( void ) {
ezLCDInt = true;
}
Code: Select all
#include <Salinity.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 <RF.h>
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <ReefAngel.h>
byte lcdrelay = 0;
byte lcdtype = 0;
//wire.write variable number
byte param[2];
byte TouchIn[4];
void DrawCustomMain()
{
// the graph is drawn/updated when we exit the main menu &
// when the parameters are saved
ReefAngel.LCD.Clear(BtnActiveColor,5,0,127,11);
ReefAngel.LCD.DrawText(DefaultBGColor,BtnActiveColor,30,3,"My Reef Angel");
// ReefAngel.LCD.DrawDate(6, 122);
pingSerial();
#if defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor(15, 70, ReefAngel.Params,
ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue());
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor(15, 70, ReefAngel.Params);
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
pingSerial();
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox(12, 103, TempRelay);
TempRelay = ReefAngel.Relay.RelayDataE[0];
TempRelay &= ReefAngel.Relay.RelayMaskOffE[0];
TempRelay |= ReefAngel.Relay.RelayMaskOnE[0];
ReefAngel.LCD.DrawOutletBox(12, 120, TempRelay);
}
void DrawCustomGraph()
{
ReefAngel.LCD.DrawGraph(5, 15);
}
void setup()
{
ReefAngel.Init(); //Initialize controller
}
void loop()
{
GetRelay();
// ReefAngel.LCD.DrawSingleMonitor(lcdrelay, 0,20,122, 1);
// ReefAngel.LCD.DrawSingleMonitor(lcdtype, 0,80,122, 1);
if (lcdrelay < 9)
{
if (lcdtype==0) // Turn port off
{
bitClear(ReefAngel.Relay.RelayMaskOn,lcdrelay-1);
bitClear(ReefAngel.Relay.RelayMaskOff,lcdrelay-1);
}
else if (lcdtype==1) // Turn port on
{
bitSet(ReefAngel.Relay.RelayMaskOn,lcdrelay-1);
bitSet(ReefAngel.Relay.RelayMaskOff,lcdrelay-1);
}
else if (lcdtype==2) // Turn port Auto
{
bitClear(ReefAngel.Relay.RelayMaskOn,lcdrelay-1);
bitSet(ReefAngel.Relay.RelayMaskOff,lcdrelay-1);
}
}
else if (lcdrelay < 17)
{
if (lcdtype==0) // Turn port off
{
bitClear(ReefAngel.Relay.RelayMaskOnE[0],lcdrelay-9);
bitClear(ReefAngel.Relay.RelayMaskOffE[0],lcdrelay-9);
}
else if (lcdtype==1) // Turn port on
{
bitSet(ReefAngel.Relay.RelayMaskOnE[0],lcdrelay-9);
bitSet(ReefAngel.Relay.RelayMaskOffE[0],lcdrelay-9);
}
else if (lcdtype==2) // Turn port Auto
{
bitClear(ReefAngel.Relay.RelayMaskOnE[0],lcdrelay-9);
bitSet(ReefAngel.Relay.RelayMaskOffE[0],lcdrelay-9);
}
}
//send data parameter package to the auxillary monitor
Wire.beginTransmission(7); // transmit to device #10
Wire.write('$'); // send the $$$
Wire.write('$');
Wire.write('$');
paramsend(ReefAngel.Params.Temp[T1_PROBE]);
Wire.endTransmission(); // stop transmitting
ReefAngel.ShowInterface();
}
void GetRelay() //relay status sent from ezLCD
{
Wire.requestFrom(7,3);
if(Wire.available())
{
for (int a=0;a<4;a++)
TouchIn[a]=Wire.read();
}
lcdtype=TouchIn[1];
lcdrelay=TouchIn[2];
}
//function to backage int into bytes for parameters temp, pH, timers, actinic%)
void paramsend(int a)
{
param[0]=(byte)(a>>8);
param[1]=(byte)(a);
Wire.write(param,2);
}