New and trying to figure out code

OK. Then just handle the logging like you do the LEDs, except every 5 seconds.