Serial.printf("Time: %2d:%.2d:%.2d", 10, 11, 5);
outputs:
Time: 10:%.2d:%.2d
instead of:
Time: 10:11:05
apologies if this has been covered B4 !
Explore... Chat... Share...
Moderator: igrr
Serial.printf("Time: %2d:%.2d:%.2d", 10, 11, 5);
Serial.printf("Time: %2d:%2d:%2d", 10, 11, 5);
QuickFix wrote:An integer value can't contain a precision specifier (the "." dot), try this instead:Code: Select allSerial.printf("Time: %2d:%2d:%2d", 10, 11, 5);
.precision
.number
For integer specifiers (d, i, o, u, x, X): precision specifies the minimum number of digits to be written. If the value to be written is shorter than this number, the result is padded with leading zeros.
It takes about 20-25 seconds for home assistant c[…]
I tried to upgrade tof my sonoff basic R2 with the[…]
a problem Perhaps you want to define "Probl[…]
Rebooting your router will not give you a faster I[…]
There are no other notifications from esptool.py i[…]
Using the Arduino IDE, you'll learn how to set up […]
In this project, you will post to Twitter using an[…]
In this project, we will build a water level contr[…]
I guess I'm late, but I had the same problem and f[…]
Last night I received my first D1 Minis for a lear[…]
Although I am aware that this is an old post, I fe[…]