So my programming skills are a bit rusty and I could use a little help getting in the right direction. I have one of these types of displays and I am using the U8 libraries to draw onto it.
It's working fine as it is, but I have only gotten it to display plain text and currently have to write text draw code manually each time I wish to display with it.
So what I am wishing to do is instead have the screen monitor the serial output and just display whatever is getting printed. How would I get to doing this?
Heres an example of it currently:
void draw(char DisplayString[14])
{
u8g.setFont(u8g_font_unifont);
u8g.setPrintPos(10, 40);
//u8g.print(DisplayString);
u8g.drawStr( 10, 40, DisplayString);
}
u8g.firstPage();
do
{
draw("Stopping");
}
while( u8g.nextPage() );
Supposedly you should be able to print directly to it using the reference to the screen and the print function (which would be a good alternative and lets me keep serial and the screen seperate for debugging purposes), but I only get error boxes with some letters in them when I try to do anything else than just drawing text with the drawstr function of the library.
Could someone also elaborate on exactly what "firstPage" and "nextPage" does? It seems rather clumsy to have to add this all over the place. Is it only necessary in loops?
Also I remember converting a combination of strings, ints and floats, into a single string, so that it can be displayed and held as a single variable instead of having to draw each variable seperately. But I cannot remember how.