Class Vl53l0x
Represents the Vl53l0x distance sensor
Assembly: Vl53l0x.dll
View Source
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
public bool IsShutdown { get; }
Distance
The distance to the measured object
View Source
public Length? Distance { get; protected set; }
DefaultI2cAddress
The default I2C address for the peripheral
View Source
public byte DefaultI2cAddress { get; }
Fields
MinimumDistance
Minimum valid distance
View Source
public static Length MinimumDistance
MaximumDistance
Maximum valid distance
View Source
public static Length MaximumDistance
Methods
Initialize()
Initializes the VL53L0X
View Source
protected Task Initialize()
Returns
System.Threading.Tasks.Task
MeasureDistance()
Tell the sensor to take a measurement
View Source
public void MeasureDistance()
ReadSensor()
Returns the current distance/range
View Source
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
public void SetAddress(byte newAddress)
Parameters
Type | Name |
---|---|
System.Byte | newAddress |
ShutDown(bool)
Set the Shutdown state of the device
View Source
public Task ShutDown(bool state)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | state | returns true if off/shutdown, false if on |
GetSpadInfo()
Get the SPAD info
View Source
protected Tuple<int, bool> GetSpadInfo()
Returns
System.Tuple<System.Int32,System.Boolean>
PerformSingleRefCalibration(byte)
perform a sensor self calibration
View Source
protected void PerformSingleRefCalibration(byte vhvInitByte)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | vhvInitByte | The VHV init byte |
Exceptions
System.Exception
ShutDown()
Shut down/power down the sensor
View Source
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