// cheap printf from https://forum.arduino.cc/t/easy-way-of-doing-printf/369075
void setup()
{
Serial.begin(115200);
fdevopen (putChar, getChar); // See https://forum.arduino.cc/t/easy-way-of-doing-printf/369075/20
printf("0x%04X %02d:%02d:%02d.%06d\n",-1,1,2,3,micros());
}
void loop()
{
}
// See https://forum.arduino.cc/t/easy-way-of-doing-printf/369075
int getChar (FILE *fp)
{
while (!(Serial.available()));
return (Serial.read());
}
int putChar (char c, FILE *fp)
{
if (c == '\n') {
putChar ((char) '\r', fp);
}
Serial.write (c);
return 0;
}