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 WeDo >>> wd = WeDo()Activating the first motor full forward:
>>> 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.tilt 3Current distance value in meters of the distance sensor:
>>> wd.distance 0.21Feel free to contribute to the project on github. Enjoy !
I was looking to move my son on from scratch to python, but thought that letting him loose with the raspberry pi gpio interface might be a step too far. Your library has breathed new life into our wedo hub and has given us easy control over two lego (or non-lego) motors. This is so much easier than fiddling around with breadboards, jumper leads and L293D chips. Thanks for all your work!
ReplyDeleteHow can this be used independently of the python version you have?
ReplyDelete