Arduino_Automation:
- The example sketch works with a digital input. Does the same principal also apply when using analog inputs,
The code in your Original Post has no digital input, only an analog input.
No matter whether you are using analog or digital inputs the concept of moving something when a value changes is the same
- Why does this example sketch still need a delay and how do I best avoid its interferrance with the delay for measuring and printing the analog value into the serial monitor
I presume the delay() is just there to make the LEDs flash.
The demo Several Things at a Time illustrates the use of millis() to manage timing without blocking. It may help with understanding the technique.
Have a look at Using millis() for timing. A beginners guide if you need more explanation.
...R