Skip to main content

Python interface to Carrera(R) DIGITAL 124/132 slotcar systems

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

carreralib-1.0.2.tar.gz (45.2 kB view hashes)

Uploaded Source

Built Distribution

carreralib-1.0.2-py3-none-any.whl (14.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page