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(newMassLossPerLevelRise int16)
- func (ls HX711) SetMassOfMechanic(newMass int16)
- func (ls HX711) SetOffsetAndCalibrationFactor(offset int32, calibrationFactor float32) error
- 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, massOfMechanic, massLossPerLevelRise int16, limit uint8, ) *HX711
NewHX711 returns a level sensor based on reading of a load cell connected to the first channel of a HX711. Please read the documentation of the HX711 for offset and calibration factor of the configurable ADC. Please read the documentation of base level sensor for the other parameters.
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) OffsetAndCalibrationFactor ¶
OffsetAndCalibrationFactor returns linear correction values, used for reading.
func (HX711) SetMassLossOnImmersion ¶
func (ls HX711) SetMassLossOnImmersion(newMassLossPerLevelRise int16)
SetMassLossOnImmersion set a new value for the mass loss per immersion. 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 relates to the immersion.
func (HX711) SetMassOfMechanic ¶
func (ls HX711) SetMassOfMechanic(newMass int16)
SetMassOfMechanic set a new value for the used mass (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.