HX711驱动程序库
描述
该库允许使用gpiozero库通过Raspberry Pi驱动HX711负载放大器。
设置频道和增益
读取原始值
此软件包要求在Python 3中安装gpiozero 。
例子
from hx711_gpiozero import HX711
from time import sleep
spi = HX711 ()
print ( "Initiating ..." )
init_reading = spi . value
sleep ( 1 )
input ( "Put a known mass on the scale, then press `enter`." )
try :
rel_weight = float ( input ( "What is the weight of the known mass? \n " ))
except