Skip to content

Latest commit

 

History

History
47 lines (34 loc) · 1.2 KB

README.md

File metadata and controls

47 lines (34 loc) · 1.2 KB

castle-link-py

Read/Write to Castle Creations ESC with Python

Castle Serial Link

Why?

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!

How?

Hardware

You are going to need some Castle Creations hardware.

Software

csl = CastleSerialLink(port="/dev/ttyUSB0", baudrate=115200)

Read

csl.listen(40) # background thread 40 Hz
for i in range(100):
    time.sleep(0.5)
    print(csl.state)
csl.stop()

Write

csl.write("throttle", 65535//2+3000)  # move forward

Remove sudo requirement

sudo usermod -a -G dialout

Refs