HectorMB Posted July 31, 2022 Posted July 31, 2022 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. Quote
Mr Jos Posted July 31, 2022 Posted July 31, 2022 Have fun reading; Motors with rotation sensors — pybricks v3.2.0b1-r3 documentation When I started with programming the EV3 with micropython, I knew nothing. By reading @Pybricks good documentation I managed to advance my programs more and more. I hope I linked the good site to the hub/motors you use as I only use the EV3 documentation so far. Quote
ord Posted August 1, 2022 Posted August 1, 2022 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 . Quote
HectorMB Posted August 1, 2022 Author Posted August 1, 2022 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... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.