Easy😆 and fast💨 MODI Python API package.
- Free software: MIT license
- Documentation: https://pymodi.readthedocs.io.
PyMODI supports a control of modular electronics based on MODI modules developed by LUXROBO
- Easy control of modules through serial connection on Windows, Linux, and MacOS
- Direct CAN communication on raspberry pi and other platforms
- Support on Python version >= 3.6
- Utilities of firmware update and low-level debugging of the modules
master | develop |
---|---|
System | 3.6 | 3.7 | 3.8 |
---|---|---|---|
Linux | |||
Mac OS | |||
Windows |
We appreciate all contributions. If you are planning to report bugs, please do so at https://github.com/LUXROBO/pymodi/issues. Feel free to fork our repository to your local environment, and please send us feedback by filing an issue.
If you want to contribute to pymodi, be sure to review the contribution guidelines. This project adheres to pymodi's code of conduct. By participating, you are expected to uphold this code.
Install the latest PyMODI if you haven't installed it yet:
pip install -U pymodi --user
You can also install PyMODI at develop branch with:
pip install git+https://github.com/LUXROBO/pymodi.git@develop --user --upgrade
Import modi package and create MODI instance:
import modi
bundle = modi.MODI()
List connected modules:
bundle.modules
List connected LED modules and pick the first one:
bundle.leds # List.
bundle.leds[0] # Pick.
Let's blink the LED's light 5 times:
import time
led = bundle.leds[0]
for _ in range(5):
led.turn_on()
time.sleep(1)
led.turn_off()
time.sleep(1)
If you are still not sure how to use PyMODI, you can play an interactive PyMODI tutorial by running a command of
$ python -m modi --tutorial
Moreover, we provide some usage and creation examples.