Issues with Millis function and sensors

Thanks Idahowalker, I will take a look and apply your suggestions