2018-11-07 09:50 PM
how to convert uint8_t to string and show in SSD1306_Puts
i try like this.
uint8_t check;
SSD1306_Puts("choose dreep"+String(uint8_t), &Font_7x10, 1);
2018-11-07 11:15 PM
Are you talking about a C++ project ?
The library containing SSD1306_Puts() is most probably not. I guess it wants a pointer as first parameter (uint8_t *).
> how to convert uint8_t to string
You cannot. "Strings" are arrays in plain C.
2018-11-07 11:34 PM
is it written like this. please help
SSD1306_Puts((uint8_t*)check, &Font_11x18, 0);
2018-11-07 11:52 PM
As said, I don't know this library, or said function. But supposedly, something like this should do:
uint8_t string[STRSIZE];
...
sprintf (string, "...
SSD1306_Puts (string, &Font_11x18, 0);
You would need some type casts (char to uint8_t), and the sprintf() formattings, of course. And it's your responsibility to check for the array (string) sizes.
You could use own code to create/combine strings, to avoid the costly clib functions (printf(), sprintf(), etc.).
2018-11-07 11:58 PM
Okay thank you very much AvaTar.