Help to Ping only every 5 sec, and also how to send digits to my 7-seg.display!?

Nick Gammon: I have a photoresistor connected

The correct answer to Nick's question is "nothing", because you have a semicolon at the end of your "if"