servo sweep loop

Hi,

Going into a servo sweep loop and at the same time having
another digital output active shifting with a certain timing (i.e. LED blink)
This LED blink will be interrupted during the servo sweep loop and start blinking again after the servo movement.
Can I find a way to keep other activities running during a servo sweep?
I use this kind of servo sweep loop.

for(pos = 45; pos < 90; pos += 1)
{
myservo.write(pos);
delay(40);
}
else

You need to change your approach to the sweep so you don't use FOR because that blocks until it completes. Look at the servo code in Several Things at a Time

...R

Thanks!

I understand you use millis() rather than delay() to keep track of timing not to be locked into
a fixed sweep loop.

/Per-Ake