Skip to main content

Class Nau7802

24-Bit Dual-Channel ADC For Bridge Sensors

Assembly: Nau7802.dll
View Source
Declaration
public class Nau7802 : ByteCommsSensorBase<Mass>, IObservable<IChangeResult<Mass>>, IDisposable, IMassSensor, ISamplingSensor<Mass>, ISensor<Mass>, ISensor, ISamplingSensor, II2cPeripheral

Inheritance: System.Object -> Meadow.Foundation.ObservableBase<UNIT>

Implements:
System.IObservable<Meadow.IChangeResult<Meadow.Units.Mass>>, System.IDisposable, Meadow.Peripherals.Sensors.Mass.IMassSensor, Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Mass>, Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Mass>, Meadow.Peripherals.Sensors.ISensor, Meadow.Peripherals.Sensors.ISamplingSensor, Meadow.Hardware.II2cPeripheral

Properties

DefaultSamplePeriod

Default sample period

View Source
Declaration
public TimeSpan DefaultSamplePeriod { get; }

Mass

The last read Mass

View Source
Declaration
public Mass? Mass { get; }

DefaultI2cAddress

The default I2C address for the peripheral

View Source
Declaration
public byte DefaultI2cAddress { get; }

Methods

Tare()

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

View Source
Declaration
public void Tare()

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 before using the sensor

View Source
Declaration
public int CalculateCalibrationFactor()
Returns

System.Int32: The calibration factor as an int### SetCalibrationFactor(int, Mass) Sets the sensor's calibration factor based on a factor calculated with a know weight by calling Meadow.Foundation.Sensors.LoadCell.Nau7802.CalculateCalibrationFactor().

View Source
Declaration
public void SetCalibrationFactor(int factor, Mass knownValue)
Parameters
TypeName
System.Int32factor
Meadow.Units.MassknownValue

ReadSensor()

Reads data from the sensor

View Source
Declaration
protected override Task<Mass> ReadSensor()
Returns

System.Threading.Tasks.Task<Meadow.Units.Mass>: The latest sensor reading

Implements

  • System.IObservable<Meadow.IChangeResult<Meadow.Units.Mass>>
  • System.IDisposable
  • Meadow.Peripherals.Sensors.Mass.IMassSensor
  • Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Mass>
  • Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Mass>
  • Meadow.Peripherals.Sensors.ISensor
  • Meadow.Peripherals.Sensors.ISamplingSensor
  • Meadow.Hardware.II2cPeripheral