Skip to content
Python wrapper for Monarco HAT C drivers
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
monarco-c
pymonarco_hat
.gitignore
LICENSE
README.md
requirements.txt
setup.py

README.md

pymonarco-hat

Python3 wrapper for Monarco HAT C drivers, see Monarco driver repository

Getting started

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

Build library

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.

Install wrapper

Run:

cd ~/pymonarco-hat
python3 setup.py install

Run example

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

Note

  • Counter functionality is not implemented (yet)

Requirements

  • Python 3.6 and above.

License

Under MIT license. See LICENSE.

Authors

You can’t perform that action at this time.