Maestro
Maestro copied to clipboard
Add context support
Thanks for this excellent module. Im using it to automate control of a Maestro for electron microscopy. Its very useful.
I added a feature to simplify opening and closing the USB port. Then it never stays open by accident. This is called 'context' and implements the with
statement in python.
An example using context support:
with maestro.Controller(ttyStr='COM4') as servo:
position = 6532
servo.setSpeed(1, 10)
The USB port is closed automatically at the end.