int hr;
int min;
int sec;
char s [90];
// -----------------------------------------------------------------------------
void
getHrMinSec (
const char *time )
{
sscanf (time, "%d:%d:%d", &hr, &min, &sec);
sprintf (s, " hr %d, min %2d, sec %2d", hr, min, sec);
Serial.println (s);
}
void
loop (void)
{
if (Serial.available ()) {
char buf [0];
int n = Serial.readBytesUntil ('\n', buf, sizeof(buf)-1);
buf [n] = '\0'; // terminate with nul
getHrMinSec (buf);
}
}
void
setup (void)
{
Serial.begin (9600);
getHrMinSec ("10:15:32");
}