Created
June 27, 2015 11:35
-
-
Save Pygmalion69/f673425ce9a4ce37e142 to your computer and use it in GitHub Desktop.
Pi Rover: send command and data byte to controller, http://goo.gl/tRcYrB
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
#!/usr/bin/python | |
#title :send.py | |
#description :Send command and data byte to motor controller. | |
#author :helfrich | |
#================================================================ | |
import serial | |
import sys | |
ser = serial.Serial('/dev/ttyUSB0', 19200, timeout = 1) | |
print(sys.argv[1]) | |
ser.write(chr(int(sys.argv[1]))) | |
if (len(sys.argv) > 2): | |
print(sys.argv[2]) | |
ser.write(chr(int(sys.argv[2]))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment