Skip to main content

Class Tsl2591

Driver for the TSL2591 light-to-digital converter

Assembly: Tsl2591.dll
View Source
Declaration
public class Tsl2591 : ByteCommsSensorBase<(Illuminance? FullSpectrum, Illuminance? Infrared, Illuminance? VisibleLight, Illuminance? Integrated)>, IObservable<IChangeResult<(Illuminance? FullSpectrum, Illuminance? Infrared, Illuminance? VisibleLight, Illuminance? Integrated)>>, ISamplingSensor<(Illuminance? FullSpectrum, Illuminance? Infrared, Illuminance? VisibleLight, Illuminance? Integrated)>, ISensor<(Illuminance? FullSpectrum, Illuminance? Infrared, Illuminance? VisibleLight, Illuminance? Integrated)>, IDisposable, ILightSensor, ISamplingSensor<Illuminance>, ISensor<Illuminance>, ISensor, ISamplingSensor, IPowerControllablePeripheral

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

Implements:

Expand

System.IObservable<Meadow.IChangeResult<System.ValueTuple<System.Nullable<Meadow.Units.Illuminance>,System.Nullable<Meadow.Units.Illuminance>,System.Nullable<Meadow.Units.Illuminance>,System.Nullable<Meadow.Units.Illuminance>>>>, Meadow.Peripherals.Sensors.ISamplingSensor<System.ValueTuple<System.Nullable<Meadow.Units.Illuminance>,System.Nullable<Meadow.Units.Illuminance>,System.Nullable<Meadow.Units.Illuminance>,System.Nullable<Meadow.Units.Illuminance>>>, Meadow.Peripherals.Sensors.ISensor<System.ValueTuple<System.Nullable<Meadow.Units.Illuminance>,System.Nullable<Meadow.Units.Illuminance>,System.Nullable<Meadow.Units.Illuminance>,System.Nullable<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.IPowerControllablePeripheral

Properties

PackageID

Sensor package ID

View Source
Declaration
public int PackageID { get; }

DeviceID

Sensor device ID

View Source
Declaration
public int DeviceID { get; }

Gain

Gain of the sensor

View Source
Declaration
public Tsl2591.GainFactor Gain { get; set; }

IntegrationTime

Integration time for the sensor

View Source
Declaration
public Tsl2591.IntegrationTimes IntegrationTime { get; set; }

FullSpectrumLuminosity

Full spectrum luminosity (visible and infrared light combined)

View Source
Declaration
public Illuminance? FullSpectrumLuminosity { get; }

InfraredLuminosity

Infrared light luminosity

View Source
Declaration
public Illuminance? InfraredLuminosity { get; }

VisibleLightLuminosity

Visible light luminosity

View Source
Declaration
public Illuminance? VisibleLightLuminosity { get; }

Illuminance

Visible lux

View Source
Declaration
public Illuminance? Illuminance { get; }

Methods

ReadSensor()

Reads data from the sensor

View Source
Declaration
protected override Task<(Illuminance? FullSpectrum, Illuminance? Infrared, Illuminance? VisibleLight, Illuminance? Integrated)> ReadSensor()
Returns

System.Threading.Tasks.Task<System.ValueTuple<System.Nullable<Meadow.Units.Illuminance>,System.Nullable<Meadow.Units.Illuminance>,System.Nullable<Meadow.Units.Illuminance>,System.Nullable<Meadow.Units.Illuminance>>>: The latest sensor reading### RaiseEventsAndNotify(IChangeResult<(Illuminance? FullSpectrum, Illuminance? Infrared, Illuminance? VisibleLight, Illuminance? Integrated)>) Raise events for subscribers and notify of value changes

View Source
Declaration
protected override void RaiseEventsAndNotify(IChangeResult<(Illuminance? FullSpectrum, Illuminance? Infrared, Illuminance? VisibleLight, Illuminance? Integrated)> changeResult)
Parameters
TypeNameDescription
Meadow.IChangeResult<System.ValueTuple<System.Nullable<Meadow.Units.Illuminance>,System.Nullable<Meadow.Units.Illuminance>,System.Nullable<Meadow.Units.Illuminance>,System.Nullable<Meadow.Units.Illuminance>>>changeResultThe updated sensor data

PowerOn()

Power the sensor on

View Source
Declaration
public Task PowerOn()
Returns

System.Threading.Tasks.Task

PowerOff()

Power the sensor off

View Source
Declaration
public Task PowerOff()
Returns

System.Threading.Tasks.Task

Events

FullSpectrumUpdated

Raised when Full Spectrum Illuminance value changes

View Source
Declaration
public event EventHandler<IChangeResult<Illuminance>> FullSpectrumUpdated
Event Type

System.EventHandler<Meadow.IChangeResult<Meadow.Units.Illuminance>>

InfraredUpdated

Raised when Infrared Illuminance value changes

View Source
Declaration
public event EventHandler<IChangeResult<Illuminance>> InfraredUpdated
Event Type

System.EventHandler<Meadow.IChangeResult<Meadow.Units.Illuminance>>

VisibleLightUpdated

Raised when Visible Light value changes

View Source
Declaration
public event EventHandler<IChangeResult<Illuminance>> VisibleLightUpdated
Event Type

System.EventHandler<Meadow.IChangeResult<Meadow.Units.Illuminance>>

Updated

Raised when Luminosity value changes

View Source
Declaration
public event EventHandler<IChangeResult<Illuminance>> Updated
Event Type

System.EventHandler<Meadow.IChangeResult<Meadow.Units.Illuminance>>

Implements

  • System.IObservable<Meadow.IChangeResult<System.ValueTuple<System.Nullable<Meadow.Units.Illuminance>,System.Nullable<Meadow.Units.Illuminance>,System.Nullable<Meadow.Units.Illuminance>,System.Nullable<Meadow.Units.Illuminance>>>>
  • Meadow.Peripherals.Sensors.ISamplingSensor<System.ValueTuple<System.Nullable<Meadow.Units.Illuminance>,System.Nullable<Meadow.Units.Illuminance>,System.Nullable<Meadow.Units.Illuminance>,System.Nullable<Meadow.Units.Illuminance>>>
  • Meadow.Peripherals.Sensors.ISensor<System.ValueTuple<System.Nullable<Meadow.Units.Illuminance>,System.Nullable<Meadow.Units.Illuminance>,System.Nullable<Meadow.Units.Illuminance>,System.Nullable<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.IPowerControllablePeripheral