Recommended Posts

Hello everyone, 

 

I am starting my journey into programming the Lego mindstorms hub through python. At the moment, I am going through quite useful tutorials (https://antonsmindstorms.com/ and Creator Academy; thanks for the huge help!!!!). Next, I am wondering how to run more than one motors in parallel. My first attempt was the following:

 

# Create your objects here.
hub = MSHub()
motorA = Motor("A")
motorB = Motor("B")
# Write your program here.
motorA.set_default_speed(-50)
motorB.set_default_speed(50)
motorA.start()
motorB.start()
wait_for_seconds(1)
motorA.stop()
motorB.stop()

So OK, with this I can run both at different speed, time and direction. Nevertheless, its control is via time, which might not be the most accurate way.

Now I was wondering if there is a way to run more than one motors in parallel and run each of them, for example, X and Y degrees. 

 

Best and thank a lot in advance!

 

H. 

Share this post


Link to post
Share on other sites
19 hours ago, HectorMB said:

Now I was wondering if there is a way to run more than one motors in parallel and run each of them, for example, X and Y degrees.

I don't think so with the Mindstorms official (python) software and I see this as a huge limitation of the software.

With Pybricks you can control as many motors in parallel as you want by setting wait=False as a parameter :purrr:.

Share this post


Link to post
Share on other sites

I have already started programming with Pybricks, and seems quite easier. What surprises me in the Lego software is that it is indeed posible to control several motors simoultaneously using block coding, but seems not that clear when coding in Python...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.