func (hx711 *Hx711) waitForDataReady() error {
	err := hx711.clockPin.Out(gpio.Low)
	if err != nil {
		return fmt.Errorf("set clock pin to low error: %v", err)
	}
	var level gpio.Level
	for i := 0; i < 11; i++ {
		level = hx711.dataPin.Read()
		if level == gpio.Low {
			return nil
		}
		hx711.dataPin.WaitForEdge(100 * time.Millisecond)
	}
	return ErrTimeout
}
waitForDataReady waits for data to go to low which means chip is ready
package hx711
import (
	"fmt"
	"time"
	"periph.io/x/periph/conn/gpio"
	"periph.io/x/periph/conn/gpio/gpioreg"
	"periph.io/x/periph/host"
)
func HostInit() error {
	_, err := host.Init()
	return err
}
func NewHx711(clockPinName string, dataPinName string) (*Hx711, error) {
	hx711 := &Hx711{numEndPulses: 1}
	hx711.clockPin = gpioreg.ByName(clockPinName)
	if hx711.clockPin == nil {
		return nil, fmt.Errorf("clockPin is nill")
	}
	hx711.dataPin = gpioreg.ByName(dataPinName)
	if hx711.dataPin == nil {
		return nil, fmt.Errorf("dataPin is nill")
	}
	err := hx711.dataPin.In(gpio.PullNoChange, gpio.FallingEdge)
	if err != nil {
		return nil, fmt.Errorf("dataPin setting to in error: %v", err)
	}
	return hx711, nil
}
func (hx711 *Hx711) setClockHighThenLow() error {
	err := hx711.clockPin.Out(gpio.High)
	if err != nil {
		return fmt.Errorf("set clock pin to high error: %v", err)
	}
	err = hx711.clockPin.Out(gpio.Low)
	if err != nil {
		return fmt.Errorf("set clock pin to low error: %v", err)
	}
	return nil
}
func (hx711 *Hx711) Reset() error {
	err := hx711.clockPin.Out(gpio.Low)
	if err != nil {
		return fmt.Errorf("set clock pin to low error: %v", err)
	}
	err = hx711.clockPin.Out(gpio.High)
	if err != nil {
		return fmt.Errorf("set clock pin to high error: %v", err)
	}
	time.Sleep(70 * time.Microsecond)
	err = hx711.clockPin.Out(gpio.Low)
	if err != nil {
		return fmt.Errorf("set clock pin to low error: %v", err)
	}
	return nil
}
func (hx711 *Hx711) Shutdown() error {
	err := hx711.clockPin.Out(gpio.High)
	if err != nil {
		return fmt.Errorf("set clock pin to high error: %v", err)
	}
	return nil
}