HX711.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:FoodBox_Hardware 作者: FatCatProject 项目源码 文件源码
def __init__(self, dout=4, pd_sck=18, gain=128, readBits=24, offset=-96096, scale=925):
        self.PD_SCK = pd_sck
        self.DOUT = dout
        self.readBits = readBits
        self.twosComplementOffset = 1 << readBits
        self.twosComplementCheck = self.twosComplementOffset >> 1

        GPIO.setmode(GPIO.BCM)
        GPIO.setup(self.PD_SCK, GPIO.OUT)
        GPIO.setup(self.DOUT, GPIO.IN)

        self.GAIN = 0
        self.set_offset(offset)
        self.set_scale(scale)
        self.lastVal = 0

        self.set_gain(gain)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号