It felt a little bit limited on that and found some basic python code on github from Ian Daniher to drive it.
and, I could not help it ... I debugged it, pythonized it, documented it and published it properly on Pypi !
To install it:
pip install wedoTo initialize it if you have a single device:
>>> from wedo import WeDoActivating the first motor full forward:
>>> wd = WeDo()
>>> wd.motor_a = 100Activating the second motor half speed/force backward:
>>> wd.motor_b = -50Current value of the tilt sensor, you can find the matching constants FLAT, TILT_BACK, TILT_FORWARD, TILT_LEFT, TILT_RIGHT in the wedo package:
>>> wd.tiltCurrent distance value in meters of the distance sensor:
3
>>> wd.distanceFeel free to contribute to the project on github. Enjoy !
0.21
0 Response to "Python support for the Lego WeDo kit"
Post a Comment