Open EricVanderhoof opened 3 months ago
Can you describe what's wrong with the "adv. servo write pin us" block in more details and/or share your code demonstrating the problem? I've tested it again on my end, but don't see any problems. Both the normal and advanced blocks generates the exact same micropython code so they should work identically.
The lack of calibration for servo is because that would require an object oriented approach (ie. create servo object for each servo, set calibration, then use servo object to control servo), which is a poor fit for blocks programming and confusing for beginners.
Support for continuous rotation isn't hard as it's just a simple mapping, but without calibration I suspect that the zero point will result in a non-zero movement in many servos.
The map block (...under the Data category) should hopefully provide an adequate alternative for those who needs support for calibration and continuous rotation.
Hi Cort! It's Eric from Ohio, USA. I would say I hope you're having a good summer if you weren't almost directly on the equator.
I am trying out some new code for next year's robotics class, and I noticed that although the original servo microseconds command works great, the advanced version that allows for a numerical input is not. It isn't a huge problem, since I have successfully used the advanced servo angle function and can map the values. It would just make the code a bit clearer to students when we are learning about PWM control of servos.
If you get a chance and it wasn't too hard, it would also be nice to be able to calibrate servos' max and min ranges as well as use the continuous rotation mode directly (as described here: https://docs.micropython.org/en/latest/pyboard/tutorial/servo.html ). If not, no problem. It's working well as it is with a simple mapping function that I wrote.
I've attached an image of the code that works with the block that doesn't work pulled out to the side.
Thanks for making such a great tool!