How to Convert Serial.printf() line into String???

charnjit

Well-known member
if we have some information lines like this
C++:
  Serial.printf("Read %s into memory at %08X; %d bytes\n", SMP_WAV[i], SMP_addr[i], sizes[i]);
can i convert it into string for use in single line function of ili9141 display.
for example any idea like this .... this funtion to print line on display
C++:
     void TFT_INFO (String INFO)   {
        tft.fillScreen(ILI9341_BLUE);
        tft.setCursor(10, 100);
        tft.setTextColor(ILI9341_WHITE, ILI9341_WHITE);   
        tft.setTextSize(3);
        tft.println(INFO);   
        tft.setTextColor(ILI9341_WHITE, ILI9341_YELLOW);
                                 }
i want to write a single line some thing like
C++:
TFT_INFO ("Read %s into memory at %08X; %d bytes\n", SMP_WAV[i], SMP_addr[i], sizes[i]);
.
means write one line TFT_INFO(); instead of repeat 6-7 lines of tft.xxxx();
I want to get String INFO as full line of output of
C++:
  Serial.printf("Read %s into memory at %08X; %d bytes\n", SMP_WAV[i], SMP_addr[i], sizes[i]);
is it possible ???????
 
THANK YOU @shawn.
it is one what i want
C++:
  Serial.printf("Read %s into memory at %08X; %d bytes\n", SMP_WAV[i], SMP_addr[i], sizes[i]);
            snprintf(buffer, sizeof(buffer),"Read %s into memory at %08X; %d bytes\n", SMP_WAV[i], SMP_addr[i], sizes[i]); TFT_PRINT_INFO(buffer);
working as i want.
 
Back
Top