Characteristic Locus
Inheritance System.Object > Hx711
Implements System.IDisposable
Namespace Meadow.Foundation.Sensors.LoadCell
Assembly Hx711.dll

Syntax

public class Hx711 : FilterableChangeObservableBase<FloatChangeResult, float>, IDisposable

Constructors

Hx711(IDigitalOutputPort, IDigitalInputPort)

Declaration
public Hx711(IDigitalOutputPort sck, IDigitalInputPort dout)

Parameters

Type Name Description
IDigitalOutputPort sck
IDigitalInputPort dout

Hx711(IIODevice, IPin, IPin)

Creates an instance of the NAU7802 Driver class

Declaration
public Hx711(IIODevice device, IPin sck, IPin dout)

Parameters

Type Name Description
IIODevice device
IPin sck
IPin dout

Properties

Gain

Declaration
public Hx711.AdcGain Gain { get; }

Property Value

Type Description
Hx711.AdcGain

IsDisposed

Declaration
public bool IsDisposed { get; }

Property Value

Type Description
System.Boolean

IsSleeping

Declaration
public bool IsSleeping { get; }

Property Value

Type Description
System.Boolean

Methods

CalculateCalibrationFactor()

Calculates the calibration factor of the load cell. Call this method with a known weight on the sensor, and then use the returned value in a call to SetCalibrationFactor(Int32, Weight) before using the sensor.

Declaration
public int CalculateCalibrationFactor()

Returns

Type Description
System.Int32

Dispose()

Dispose managed resources

Declaration
public void Dispose()

Dispose(Boolean)

Declaration
protected virtual void Dispose(bool disposing)

Parameters

Type Name Description
System.Boolean disposing

GetWeight()

Gets the current sensor weight

Declaration
public Weight GetWeight()

Returns

Type Description
Weight

SetCalibrationFactor(Int32, Weight)

Sets the sensor's calibration factor based on a factor calculated with a know weight by calling CalculateCalibrationFactor().

Declaration
public void SetCalibrationFactor(int factor, Weight knownValue)

Parameters

Type Name Description
System.Int32 factor
Weight knownValue

Sleep()

Puts the device into low-power sleep mode

Declaration
public void Sleep()

Tare()

Tares the sensor, effectively setting the current weight reading to relative zero.

Declaration
public void Tare()

Wake()

Takes the device out of low-power sleep mode

Declaration
public void Wake()