Skip to main content

Class Bh1750

Represents a BH1750 ambient light sensor

Assembly: Bh1750.dll
View Source
public class Bh1750 : ByteCommsSensorBase<Illuminance>, IObservable<IChangeResult<Illuminance>>, IDisposable, ILightSensor, ISamplingSensor<Illuminance>, ISensor<Illuminance>, ISensor, ISamplingSensor, II2cPeripheral

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

Implements:
System.IObservable<Meadow.IChangeResult<Meadow.Units.Illuminance>>, System.IDisposable, Meadow.Peripherals.Sensors.Light.ILightSensor, Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Illuminance>, Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Illuminance>, Meadow.Peripherals.Sensors.ISensor, Meadow.Peripherals.Sensors.ISamplingSensor, Meadow.Hardware.II2cPeripheral

Properties

LightTransmittance

BH1750 Light Transmittance (27.20-222.50%)

View Source
public double LightTransmittance { get; set; }

MeasuringMode

BH1750 Measuring Mode

View Source
public Bh1750.MeasuringModes MeasuringMode { get; set; }

Illuminance

The current illuminance read by the sensor

View Source
public Illuminance? Illuminance { get; }

DefaultI2cAddress

The default I2C address for the peripheral

View Source
public byte DefaultI2cAddress { get; }

Methods

ReadSensor()

Read the current luminosity

View Source
protected override Task<Illuminance> ReadSensor()
Returns

System.Threading.Tasks.Task<Meadow.Units.Illuminance>: The current Illuminance value

Implements

  • System.IObservable<Meadow.IChangeResult<Meadow.Units.Illuminance>>
  • System.IDisposable
  • Meadow.Peripherals.Sensors.Light.ILightSensor
  • Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Illuminance>
  • Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Illuminance>
  • Meadow.Peripherals.Sensors.ISensor
  • Meadow.Peripherals.Sensors.ISamplingSensor
  • Meadow.Hardware.II2cPeripheral