hold last sensor value

PaulS:

    delay(30);

So, you DID mean periodically? You swore up and down you didn't.

the delay was just in there to slow things down temporarily

:.