Task 5 - Control the Servo Motor Position via a Photocell In this task you will create a model that sets the position of the servo motor according to light intensity detected by a photocell. However, this period is somewhat elastic because most servo controllers wait for the ON pulse after being pulled low for a few ms.
This is Fast PWM, there's another version called phase-correct PWM and it typically operates at a lower timer frequency using more bits for the counter but is more accurate on the timing.
In practice pretty much all servos would adopt their neutral position regardless of whether you sent the pulse every 5ms or every 20ms as it's the width of the pulse once it is detected that governs the servo position.
Inside this 20ms duty cycle, the function will create a pulse of 0. Connect the other ends of the photocell and the resistor together and then to the analog input pin 0 on the board.
Use a photocell and a resistor instead of the potentiometer you used in Task 4. As your rotate the potentiometer, its resistance changes. I thank you. The neutral position center or stop is typically an ON pulse of 1. I did purchase a LB hardware developers kit, so that may be a way to go.