display stored string using 8uglib

Hi,
im kind of a newbie on arduino and i need help from experts :stuck_out_tongue:

I've been able to display pretty much what i want on my GLCD TF7565 using th u8glib library. I'm able to display a string using this commande

u8g.drawStr(0, 0, "hello world");

but i want to display a double that i converted to a string but when i do something like this:

String testString;
//code puting a double value in testString
//...
//...
u8g.drawStr(0, 0, testString);

the program is giving me an error while compiling, it says:

no matching function for call to 'U8GLIB_LM6059::drawStr(int,int,String&)

im i doing something wrong or its just impossible to display a previously stored String using the u8glib library ?

Thank you !

I assume, that you need to convert the String object to a character array before passing it to drawStr.
Use toCharArray() - Arduino Reference.

Oliver

I just tried it and its working Thank you so much !!!!

glcd includes overloaded functions to handle all the string types.
For String it uses an overloaded wrapper function to handle it.
For u8g, It would be something like:

u8g_uint_t U8GLIB::drawStr(u8g_uint_t x, u8g_uint_t y, String &str )
{
   return( drawStr(x, y, str));
}

--- bill