Documentation
¶
Index ¶
- type HX711
- func (ls HX711) Calibrate(zero bool) error
- func (ls HX711) ConfigStatus() byte
- func (ls HX711) Configure() error
- func (ls HX711) IsCritical() (bool, error)
- func (ls HX711) Limit() uint8
- func (ls HX711) OffsetAndCalibrationFactor() (int32, float32)
- func (ls HX711) SetLimit(newLimit uint8)
- func (ls HX711) SetMassLossOnImmersion(newMassLossGramPerCm float32)
- func (ls HX711) SetMassOfMechanic(newMassGram float32)
- func (ls HX711) SetOffsetAndCalibrationFactor(offset int32, calibrationFactor float32)
- func (ls HX711) Value() uint8
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HX711 ¶
type HX711 struct {
// contains filtered or unexported fields
}
func NewHX711 ¶
func NewHX711( sckPin outputPinner, dataPin inputPinner, offset int32, calibrationFactor float32, limitCm uint8, ) *HX711
NewHX711 returns a level sensor based on reading of a load cell connected to the first channel of a HX711.
func (HX711) Calibrate ¶
Calibrate calibrates to the mass of mechanic, if value is false, otherwise measures the offset.
func (HX711) ConfigStatus ¶
func (ls HX711) ConfigStatus() byte
func (HX711) IsCritical ¶
func (HX711) Limit ¶
func (ls HX711) Limit() uint8
Limit returns the limit for the level in cm (0..255).
func (HX711) OffsetAndCalibrationFactor ¶
OffsetAndCalibrationFactor returns linear correction values, used for reading.
func (HX711) SetLimit ¶
func (ls HX711) SetLimit(newLimit uint8)
SetLimit sets a new limit in cm (0..255)
func (HX711) SetMassLossOnImmersion ¶
func (ls HX711) SetMassLossOnImmersion(newMassLossGramPerCm float32)
SetMassLossOnImmersion set a new value for the mass loss in gram per immersion in cm. This value is for calculation of the level and has no influence on the calibration. The mass loss can be calculated by the density of the used fluid (e.g. 1g/cm³ for water) multiplied by the volume of the solid which equals 1 cm immersion.
func (HX711) SetMassOfMechanic ¶
func (ls HX711) SetMassOfMechanic(newMassGram float32)
SetMassOfMechanic set a new value for the used mass in gram (value without immersion). After change of this value a call of the calibration function is maybe useful.
func (HX711) SetOffsetAndCalibrationFactor ¶
SetOffsetAndCalibrationFactor sets linear correction values, used for reading.