jeffmakes / gpiodhx711

HX711 load cell amplifier driver making use of the libgpiod Kernel GPIO character device

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Building

Install C dependencies:

For building libgpiodhx711.a: libgpiod2 libgpiod-dev gpiod

For building the python extension: libpython3.9-dev python-dev

Build the C library and test program. This creates the libgpiodhx711.a archive: cd gpiodhx711/c make

Python bindings:

  1. Create a new venv: cd gpiod/python python3 -m venv venv

  2. Activate the virtual environment: source venv/bin/activate

  3. On RPiOS I had to install some surprisingly missing python dependencies: pip install setuptools wheel

  4. Build and install the extension. This creates the _gpiodhx711.c file and compiles it, along with libgpiodhx711.a, and links in the gpiod library from the system. The output is _gpiodhx711.abi3.so:

python setup.py develop or python setup.py install

  1. Run the module

python gpiodhx711.py

About

HX711 load cell amplifier driver making use of the libgpiod Kernel GPIO character device


Languages

Language:C 65.2%Language:Python 31.5%Language:Makefile 3.3%