Millis, repeat code. how to make it work?????

Analog sensor.

I figured it out.

Thanks for all the help.