I’m new here, been going well so far following tutorials and and forum posts/answers, but I’m stuck on a problem around converting an int to a char array to print the localtime to an ili9341 driven display.
I’ve got the following solution working to print the localtime to the display:
static bool s_tick_tock = false; time_t now = time(0); struct tm *timeinfo = localtime(&now); char buf[BUFSIZ]; int value = timeinfo->tm_hour; sprintf(buf, "%d", value); mgos_ili9341_set_font(&FreeSansBold12pt7b); mgos_ili9341_print(10, 10, buf);
While this works, it seems like a really inefficient way to do this, as I plan to do a fair bit on manipulation of the date time.
I’ve tried multiple solutions I found online for general C/C++ but none seem to work for me.
Any suggestions on what I could do?