Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
5 years, 1 month ago.
SSD1306 OLED 128x32 string print problem
I am trying to optimize the use of my oled adafruit, for that I made a simple function that more easily performs the printing of text from the device to the oled, but I have problems putting the text string, since meaningless symbols appear instead of the text I want to print, if I make a display.printf ("Test"); It works perfect, but when using the string the format fails. The function is below :
- include <string>
void printText (string text , int x, int y, int size, bool d)
display.TextSize(size); display.TextColor(WHITE); display.TextCursor(x,y); display.printf("%s\t",text); if(d){
display.display(); }
for example in the code, when call the function to print a message :
printText("Message: ", 4, 3 ,1 , false); This doesn´t work