Hi everyone,
I'm using a mega 2560 and a KS108B GLCD from sparkfun.
I've been trying to define text areas and it seems to compile just fine, but my problem arises when I go to print to the screen.
I use the textArea.CursorTo(0,0) which as I understand will put the cursor at the beginning of the text area, but this doesn't work and when I print something out it just puts it in the top left of the entire screen, not the text area.
I'm also trying to invert the pixels in another text area but instead the while screen gets inverted.
I've been looking at the examples but cannot figure out what I'm doing wrong.
Here is my code:
void setup()
{
//graphical LCD
GLCD.Init(NON_INVERTED);
GLCD.SetTextMode(SCROLL_UP);
//for temp sensors
Wire.begin();
//menu stuff
char menu1[ ] = "Option 1";
char menu2[ ] = "Option 2";
char menu3[ ] = "Option 3";
}
//text areas
gText t1; //temperature area
gText t2; //days remaining
gText t3; //current selection
gText t4; //rest of menu
void loop()
{
t1.DefineArea( 0, 0, 7, 1, SystemFont5x7, SCROLL_UP );
t2.DefineArea( 85, 0, 8, 1, SystemFont5x7, SCROLL_UP );
t3.DefineArea( 0, 16, 24, 6, SystemFont5x7, SCROLL_UP );
t4.DefineArea( 0, 24, 24, 6, SystemFont5x7, SCROLL_UP );
t3.SetFontColor(WHITE); // set font color
t3.ClearArea();
//main menu layout below. Maybe minor differences when within submenus
t1.CursorTo(0,0);
t2.CursorTo(14,0);
t1.print(avgTemp);
t1.print(" F");
t2.print("3 Days");
t3.CursorTo(0,2);
t3.print(menu1);
t4.CursorTo(0,3);
t4.print(menu2);
t4.CursorTo(0,4);
t4.print(menu3);
t4.CursorTo(0,5);
t4.print(menu4);
The print code at the bottom is how I've currently got everything to print to the correct area of the screen and I'm fine with that, but I really want help getting one text area to be inverted and the rest normal.
Thanks
-Tyler