Recent
weeks I have been working on a Python module (library) for
controlling Mindstorms EV3 and NXT, and ― here it is!
I have set up a separate page for it as it may receive updates,
documentation changes, etc., so head there to find more about it and
download it. Of course, you can freely use it for your own projects.
Its
name is MindControl and, briefly, it is a module that
conveniently links Python, a programming language, to EV3 and NXT
Mindstorms devices, letting you control motors, sensors, etc.
directly from the scripts on your computer (or anything else you run
Python on). It can control multiple EV3 and NXT devices
simultaneously, communicates with them via Bluetooth, is
synchronized, and is fully native on both sides, i.e. you can run it
using standard LEGO firmware and without any exotic Python
extensions.
For example, rotating
four motors with various angles on EV3 is as simple as this:
import mindctrl
device=mindctrl.EV3('COM8')
device.rotate(90,-180,270,-360,speed=65)
And add this to keep
the motor 1 spinning step-by-step until the touch sensor on port 1 is
pressed:
while not
device.sensor(1): device.rotate(30)
You can use other
functions and parameters (documentation is, remember, at the
dedicated page along with the downloads and the rest) for controlling relative motor movements, sensor
measurements, playing tones, logging, etc.
The aim was to provide
a library which has sufficiently many features to cover 99% of
Mindstorms projects, yet to be simple enough for nearly everyone to
use and not burden the user with low-level communications and flow
control. And Python (v 3.x in this case) is, in my humble opinion,
just a perfect language for that.
Happy coding!
An impressive share, I just given this onto a colleague who was simply carrying out a small analysis within this. And then he the fact is bought me breakfast due to the fact I uncovered it for him.. smile. So let me reword that: Thnx for any treat! But yeah Thnkx for spending time go over this, I believe strongly regarding it and really like reading more on this topic. If it is possible, as you become expertise, might you mind updating your site to comprehend details? It is actually highly a good choice for me. Large thumb up because of this text! https://royalcbd.com/product/cbd-roll-on-gel/
ReplyDelete