Jump to content

Recommended Posts

Posted

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. 

Posted
  On 7/31/2022 at 4:28 PM, 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.

Expand  

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:.

Posted

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...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...