Skip to main content

Class Vl53l0x

Represents the Vl53l0x distance sensor

Assembly: Vl53l0x.dll
View Source
Declaration
public class Vl53l0x : ByteCommsSensorBase<Length>, IObservable<IChangeResult<Length>>, IDisposable, IRangeFinder, ISamplingSensor<Length>, ISensor<Length>, ISensor, ISamplingSensor, II2cPeripheral

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

Implements:
System.IObservable<Meadow.IChangeResult<Meadow.Units.Length>>, System.IDisposable, Meadow.Peripherals.Sensors.Distance.IRangeFinder, Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Length>, Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Length>, Meadow.Peripherals.Sensors.ISensor, Meadow.Peripherals.Sensors.ISamplingSensor, Meadow.Hardware.II2cPeripheral

Properties

IsShutdown

Is the hardware shutdown / off

View Source
Declaration
public bool IsShutdown { get; }

Distance

The distance to the measured object

View Source
Declaration
public Length? Distance { get; protected set; }

DefaultI2cAddress

The default I2C address for the peripheral

View Source
Declaration
public byte DefaultI2cAddress { get; }

Fields

MinimumDistance

Minimum valid distance

View Source
Declaration
public static Length MinimumDistance

MaximumDistance

Maximum valid distance

View Source
Declaration
public static Length MaximumDistance

Methods

Initialize()

Initializes the VL53L0X

View Source
Declaration
protected Task Initialize()
Returns

System.Threading.Tasks.Task

MeasureDistance()

Tell the sensor to take a measurement

View Source
Declaration
public void MeasureDistance()

ReadSensor()

Returns the current distance/range

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

System.Threading.Tasks.Task<Meadow.Units.Length>: The current distance, returns 0 if the shutdown pin is used and is off### SetAddress(byte) Set a new I2C address

View Source
Declaration
public void SetAddress(byte newAddress)
Parameters
TypeName
System.BytenewAddress

ShutDown(bool)

Set the Shutdown state of the device

View Source
Declaration
public Task ShutDown(bool state)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
System.Booleanstatereturns true if off/shutdown, false if on

GetSpadInfo()

Get the SPAD info

View Source
Declaration
protected Tuple<int, bool> GetSpadInfo()
Returns

System.Tuple<System.Int32,System.Boolean>

PerformSingleRefCalibration(byte)

perform a sensor self calibration

View Source
Declaration
protected void PerformSingleRefCalibration(byte vhvInitByte)
Parameters
TypeNameDescription
System.BytevhvInitByteThe VHV init byte
Exceptions

System.Exception

ShutDown()

Shut down/power down the sensor

View Source
Declaration
public void ShutDown()

Implements

  • System.IObservable<Meadow.IChangeResult<Meadow.Units.Length>>
  • System.IDisposable
  • Meadow.Peripherals.Sensors.Distance.IRangeFinder
  • Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Length>
  • Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Length>
  • Meadow.Peripherals.Sensors.ISensor
  • Meadow.Peripherals.Sensors.ISamplingSensor
  • Meadow.Hardware.II2cPeripheral