Skip to content

Instantly share code, notes, and snippets.

@Pygmalion69
Created June 27, 2015 11:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pygmalion69/f673425ce9a4ce37e142 to your computer and use it in GitHub Desktop.
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
#!/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