Skip to content

Instantly share code, notes, and snippets.

@JosephGregg
Created November 27, 2017 22:04
Show Gist options
  • Save JosephGregg/201545c6f18c0841ee657e141b25c16a to your computer and use it in GitHub Desktop.
Save JosephGregg/201545c6f18c0841ee657e141b25c16a to your computer and use it in GitHub Desktop.
import time
from roboclaw import Roboclaw
rc = Roboclaw("/dev/ttyACM0",115200)
rc.Open()
voltage = rc.ReadMainBatteryVoltage(0x80)
if voltage[0]==False:
print "GETVOLTAGE Failed"
else:
print repr(float(voltage[1]) / 10) + "V"
time.sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment