@@liviosemeraro2951 The typical RC servo expects to see a pulse every 20 ms, which is why the PWM signal is set to a period of 20 ms. pin0.write_analog controls the width of the PWM pulse, which determines how far the servo will turn.
Is there a way of sensing when a servo has reached its target angle? I know I can use a pause to give it enough time to get there, but that will always be too short or too long (there's almost a 0% chance of getting it exact). It would be nice to be able to get on with whatever you want to do when it reaches that angle, rather than wasting time.
The only way to do that is to add a sensor (e.g. a mechanical or optical switch or a perforated disk or a potentiometer) to measure the sensor angle and give feedback.
@@ElektorTV Thanks for the reply. It's what I expected, though I had hoped that there was some little-known feedback from a typical servo that would do it. After all, they have a potentiometer in them and a microcontroller, so they have the 'smarts', though they would need a four-wire connection if they were going to transmit.
no problem. I didn't watch the whole video, just flicked through but it looked good for servo information. I'm just frustrated that I'm struggling to find much information on driving stepper motors or external interrupts for the micro bit. I'll get there I'm sure. Have fun, its neat technology