schodet / nxt-python

NXT-Python is a python driver/interface for the Lego Mindstorms NXT robot based on NXT_python.
https://ni.srht.site/nxt-python/latest/
GNU General Public License v3.0
237 stars 74 forks source link

Small bugfixes to motcont #160

Closed diinngg closed 3 years ago

diinngg commented 4 years ago
Eelviny commented 4 years ago

Looks good. Could you tell me a little bit more about why the 1 second sleep is needed in stop_program?

diinngg commented 4 years ago

(On the hardware I'm working with at least) If MotorControl is already running on the brick it takes around a second for it to stop, during which time the request to start MotorControl appears to be dropped. So calls to mc.start() actually just end up toggling whether MotorControl is running or not.

I admit I haven't spent a lot of time looking at this, there may be a better solution than just waiting for a second, if you feel that would be better I can take another look at it in a couple of weeks.