TCWORLD / gLCD-Library

Arduino Nokia 128x128 Graphic LCD Library.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug in print function?

opened this issue · comments

Hi,
first of all thanks for this useful library, seems to be the only one working with Arduino 1.0 right now.
ISSUE (Version 2.2): Maybe there's a bug printing text with solid background - using the print function like this...

graphic.Print("Board mode: "+String(boardmode_val),10,30,4);

...results in a totally corrupted unreadable line. I'm using the Phillips sequence, screen inverted. Switching off inversion does not help, the issue stays the same. Changing font size in either or both directions still results in a corrupted line.
Tried to figure out what's wrong but hadn't any success, sorry.

Thanks for your help!

I think it is to do with the string not being initialised properly. Can you try this and tell me if it prints properly:

String temp = "Board mode: ";
temp += String(boardmode_val);
graphic.Print(temp,10,30,4);

or alternatively this:

char temp[30];
sprintf(temp,"Board mode: %d",boardmode_val);
graphic.Print(temp,10,30,4);

If either of those don't work, I will do some experimentation and try to find the cause.

I have just checked and your code seems to work for me, but then I only have an EPSON display (I dropped and broke my phillips one).

What does the garbled text look like?

Also, is it part of a much larger program? I know that I can get garbled text if the program uses up too much RAM. Do the example sketches work for your screen? If so try changing the Print call in BasicFunctions.pde to have a background i.e. graphic.Print("Hello",40,40,4); and see if it still works.

Tom.

Thanks for your quick response - will try your suggestions as soon as
possible; get back to you then!

Am 15.01.2012 17:20, schrieb TCWORLD:

I think it is to do with the string not being initialised properly. Can you try this and tell me if it prints properly:

String temp = "Board mode: ";
temp += String(boardmode_val);
graphic.Print(temp,10,30,4);

or alternatively this:

char temp[30];
sprintf(temp,"Board mode: %d",boardmode_val);
graphic.Print(temp,10,30,4);

If either of those don't work, I will do some experimentation and try to find the cause.


Reply to this email directly or view it on GitHub:
#1 (comment)

Hi Tom,
tried your suggestions now. Unfortunately none of them worked.
I try to send a screenshot with this message, hopefully it shows up. It
shows how BasicFunctions with "background on" looks on my display.
With transparent background everything looks as it should (I guess). I
tried the sketch in the slow operating mode as well as in the fast one -
the results are exactly the same.

Best,
Hartmut

Am 15.01.2012 17:52, schrieb TCWORLD:

I have just checked and your code seems to work for me, but then I only have an EPSON display (I dropped and broke my phillips one).

What does the garbled text look like?

Also, is it part of a much larger program? I know that I can get garbled text if the program uses up too much RAM. Do the example sketches work for your screen? If so try changing the Print call in BasicFunctions.pde to have a background i.e. graphic.Print("Hello",40,40,4); and see if it still works.

Tom.


Reply to this email directly or view it on GitHub:
#1 (comment)

Image didn't show up. Anyway - looks like the rows get shifted too much into one direction or something like that.

could you send the screenshot to webmaster(at)railways-in-miniature(dot)co(dot)uk so I can take a look.

Tom.

Solved In Version 2.3

Problem due to display having a different scan direction to the library. If you have a similar problem (garbled text), see the README or examples for how to use the updated init() function.

Thanks.