Is it possible for the function Serial.print() set the length of the drawn numbers?
For example, to output function is not "0", but the string "000". Or not "50", but "0050".
To display the formatted data is very necessary.
Ogogon.
Is it possible for the function Serial.print() set the length of the drawn numbers?
For example, to output function is not "0", but the string "000". Or not "50", but "0050".
To display the formatted data is very necessary.
Ogogon.
I construct the string to output with sprintf() first.
http://www.cplusplus.com/reference/clibrary/cstdio/sprintf/
Since sprintf() is a standard C call found in <stdio.h>, you have access to it from the Arduino's C environment by default.
sprintf() (string print, formatted) allows you to specify formatting, precision, and padding just as you want.