Created
November 27, 2017 22:04
-
-
Save JosephGregg/201545c6f18c0841ee657e141b25c16a to your computer and use it in GitHub Desktop.
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
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