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
232 stars 72 forks source link

Help with motorconotrl #179

Closed Svein-Tore closed 2 years ago

Svein-Tore commented 2 years ago

I want to uset he Linus Atorf's motor control. Going to the code motcont.py I see I first have to install MotorControl22.nxc,. But thats an easy task. So, looking at motcont.py I see the following:

 mc.start()

    mc.cmd((nxt.motor.Port.A, nxt.motor.Port.B), 50, 360)
    wait()

So my question is: Will the motors be synced with this command? In the docs (https://ni.srht.site/nxt-python/latest/api/motcont.html) I get:

cmd(ports, power, tacholimit, speedreg=True, smoothstart=False, brake=False)

In the code (from motcont.py above) there is not so many parameters added. Does this simply means the last parameters are omitted? And just to add in motcont.py if needed?

schodet commented 2 years ago

Yes they will be synced.

cmd(ports, power, tacholimit, speedreg=True, smoothstart=False, brake=False)

The three last parameters have default values, if you do not give them, the function will use the default value.