Skip to content

bjarnekvae/pymonarco-hat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.