Use printf function to make code clearer. Not smaller though.
If we received nothing on the serial port, don't write to it either.

Writing to the serial port means keeping the chip at full power and serial
ports are slow.  This way we sleep much more if the serial port is disabled.
Add ability to adjust measuring period of devices.