Python bindings for Raspberry Pi HX711 C++ Library

Python bindings for Raspberry Pi HX711 C++ Library

Sample Output

The .gif above illustrates the output of a simple Python script on a Raspberry Pi Zero W where the HX711 chip was operating at 80Hz. In this example, each time the .weight function is called the median of three samples was used to calculate the weight in grams.

Examples

SimpleHX711 Example

from HX711 import *

# create a SimpleHX711 object using GPIO pin 2 as the data pin,
# GPIO pin 3 as the clock pin, -370 as the reference unit, and
# -367471 as the offset
hx = SimpleHX711(2, 3, -370, -367471)

# set the scale to output weights in ounces
hx.setUnit(Mass.Unit.OZ)

# constantly output weights using the median of

 

 

 

To finish reading, please visit source site