Will the PWMPAL allow me to tell my microcontroller:
X=distance measured by ultrasonic sensor (takes approximately 0.1 seconds for sensor to detect change)
If X=18 through 22, do nothing
If X>22, then turn servo clockwise until X<22
If X<18, then turn servo counterclockwise until X>18
I would have the microcontroller take information from the ultrasonic sensor between the 20ms pause for the servo, but the sensor takes readings every 100ms. With the 'until' statement, I'm kind of having the microcontroller perform a multitask by keeping track of the distance and controller the servo. Will the PWMPAL allow me to do this?