Replies: 2 comments
-
Thank you for your inquiry. The only way at this time is to monitor (poll) the returned value of the writeServo function where the movement has ended when returned value = 1.0 if the current position value is higher than the previous value and the returned value = 0.0 if the current position value is lower than the previous value. I have been experimenting with having the servo movement working smoothly with blocking code. This would transparently use a callback at each refresh cycle just after the falling edge of all attached servo signals. There's ample time here to set the new duty values and calculate the new positions. I'll definitely add a feature (event handler or callback) to notify when a movement completes as this would be very useful. I've been quite busy this summer but am eager to get a new release ready. This'll be my first use of events/callbacks as I only program as a hobby, but I've just recently updated my PC and used Visual Studio with GitHub Copilot. This will be a good time saver for me. |
Beta Was this translation helpful? Give feedback.
-
Thank you so much for your detailed reply, and for writing this library. I wish I could contribute but I am still learning. |
Beta Was this translation helpful? Give feedback.
-
Hi all, is there any way to be notified when a movement completes? I'd like to record the new position but only once a movement has ended. Is there an event handler or callback I can hook into?
Beta Was this translation helpful? Give feedback.
All reactions