Troubleshooting given code for dual servo operation

Hi,
So you have;

  • One LDR connected to an input, Pin3.
  • One servo connected to an output Pin10.
  • One servo connected to an output Pin11.

When the LDR is de activated do you want both servos to sweep.
When the LDR is activated do you want both servos to stop sweeping.

When the servos sweep , do you want them to sweep together, or at different rates or in opposing directions.

If sweeping together then;

  • You only need one position variable.
  • You only need one for... loop to sweep both one way,
  • You only need another single for.. loop to sweep both back the other way.

There is no need to nest your for.. loops...

Tom... :slight_smile: