PMW for dc motor, servo-mechanisms in zetptoforth. #56
-
Hi Travis I contacted you on facebook about this. ( testservo ) ( examples ) Best regards Daniel |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
_There was a reply on Facebook by Travis. For my own purposes, here is record of that ;-) There is a wiki page on operating the PWM at https://github.com/tabemann/zeptoforth/wiki/Pulse-Width-Modulation-and-Hardware-Timers-in-zeptoforth-on-the-Raspberry-Pi-Pico in case you have not read it, along with API documentation at https://github.com/tabemann/zeptoforth/blob/master/docs/words/pwm.md. An example of the PWM in action can be found at https://github.com/tabemann/zeptoforth/blob/master/test/rp2040/pwm_counter_test.fs - here we have two pins for different PWM "slices" linked by a wire, one on which we are generating an output signal and the other on which we are inputting the signal outputted by the other pin, which wraps after 65536 rising edges and generates an interrupt, which we use to increment a counter. |
Beta Was this translation helpful? Give feedback.
-
@photoplane I cannot from the code you posted tell exactly what you are trying to do, but here is some code (note I have not tested it) which may do something like what you want to do:
|
Beta Was this translation helpful? Give feedback.
@photoplane I cannot from the code you posted tell exactly what you are trying to do, but here is some code (note I have not tested it) which may do something like what you want to do: