Python3 wrapper for Monarco HAT C drivers, see Monarco driver repository
Before you can use this wrapper you need to clone the Monarco HAT Driver C repository:
Install git and build-dependencies on your Raspberry Pi running Raspbian:
sudo apt update sudo apt install git build-essential
Clone the Monarco HAT repository repository:
cd ~ git clone https://github.com/monarco/monarco-hat-driver-c.git
Clone this repository:
cd ~ git clone https://github.com/bjarnekvae/pymonarco-hat.git
In order for the Python wrapper to work we need to build a library file from the Monarco HAT source code, this can be done like this:
cd ~/pymonarco-hat/monarco-c make MONARCO_PATH=/path/to/monarco-hat-driver-c-repository
From this "libmonarco.so" will be compiled, this file will be used for the wrapper.
Run:
cd ~/pymonarco-hat python3 setup.py install
cd ~/pymonarco-hat/examples python3 monarco_example.py /path/to/lib/libmonarco.so
In most cases the script has to be run as root, unless you've given your user right to access the SPI peripheral
- Counter functionality is not implemented (yet)
- Python 3.6 and above.
Under MIT license. See LICENSE.