Skip to content

seanavery/castle-link-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

python driver for castle serial link

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages