Read/Write to Castle Creations ESC with Python
Want to get the vEgo (velocity) of your rc-car without installing wheel encoders? How about realtime battery metrics? You can even control the throttle without a pwm driver!
You are going to need some Castle Creations hardware.
csl = CastleSerialLink(port="/dev/ttyUSB0", baudrate=115200)
csl.listen(40) # background thread 40 Hz
for i in range(100):
time.sleep(0.5)
print(csl.state)
csl.stop()
csl.write("throttle", 65535//2+3000) # move forward
sudo usermod -a -G dialout