Created
January 16, 2014 16:38
-
-
Save antonvh/8458252 to your computer and use it in GitHub Desktop.
Sending a motor command to mindstorms NXT using python and the jaraco library.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from jaraco.nxt import * | |
from jaraco.nxt.messages import * | |
conn = Connection('/dev/tty.NXT-DevB') | |
cmd = SetOutputState( | |
i, | |
motor_on=True, | |
set_power=motorpower, | |
run_state=RunState.running, | |
use_regulation=True, #this was the crucial part. | |
regulation_mode=RegulationMode.motor_speed | |
) | |
conn.send(cmds) | |
# clean up | |
conn.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment