Skip to content

Latest commit

 

History

History
103 lines (74 loc) · 3.28 KB

README.rst

File metadata and controls

103 lines (74 loc) · 3.28 KB

carreralib

Latest PyPI version CI build status Documentation build status Test coverage Libraries.io SourceRank License Code style: black

This module provides a Python interface to Carrera® DIGITAL 124/132 slotcar systems connected via a serial (cable) connection, or via Bluetooth LE using Carrera AppConnect®.

>>> from carreralib import ControlUnit
>>> cu = ControlUnit('/dev/ttyUSB0')
>>> cu.version()
'5337'
>>> cu.poll()
Status(fuel=(14, 14, 14, 14, 14, 14, 0, 0), start=0, mode=6,
       pit=(False, False, False, False, False, False, False, False),
       display=8)
>>> cu.start()
>>> cu.poll()
Status(fuel=(14, 14, 14, 14, 14, 14, 0, 0), start=1, mode=6,
       pit=(False, False, False, False, False, False, False, False),
       display=8)
>>> cu.start()
>>> cu.poll()
Timer(address=1, timestamp=105295, sector=1)
>>> cu.poll()
Timer(address=0, timestamp=105410, sector=1)

For demonstration purposes, the carreralib module can also be used from the command line as a simple race management system (RMS).

Please refer to the online documentation for more information.

Installation

carreralib is available from PyPI and can be installed by running:

pip install carreralib

Project Resources

License

Copyright (c) 2015-2023 Thomas Kemmer.

Licensed under the MIT License.

Carrera® and Carrera AppConnect® are registered trademarks of Carrera Toys GmbH.

carreralib is not an official Carrera® product, and is not affiliated with or endorsed by Carrera Toys GmbH.

Thanks to Stephan Heß (a.k.a. slotbaer) for doing all the hard work.