Treehopper C# API
IProximity Interface Reference
Inheritance diagram for IProximity:
IPollable ProximitySensor Vcnl4010

Public Member Functions

Task UpdateAsync ()
 Requests a reading from the sensor and updates its data properties with the gathered values. More...
 

Properties

double Centimeters [get]
 Get the proximity reported by the sensor, in centimeters (cm) More...
 
double Inches [get]
 Get the proximity reported by the sensor, in inches (in) More...
 
double Feet [get]
 Get the proximity reported by the sensor, in feet (ft) More...
 
double Meters [get]
 Get the proximity reported by the sensor, in meters (m) More...
 
bool AutoUpdateWhenPropertyRead [get, set]
 Gets or sets whether reading from the sensor's properties should request updates from the sensor automatically (defaults to true). More...
 

Member Function Documentation

◆ UpdateAsync()

Task UpdateAsync ( )
inherited

Requests a reading from the sensor and updates its data properties with the gathered values.

Returns
An awaitable Task

Note that when AutoUpdateWhenPropertyRead is true (which it is, by default), this method is implicitly called when any sensor data property is read from — there's no need to call this method unless you set AutoUpdateWhenPropertyRead to false.

Unless otherwise noted, this method updates all sensor data simultaneously, which can often lead to more efficient bus usage (as well as reducing USB chattiness).

Implemented in Bno055, Hmc5883l, Mpu6050, L3gd20, Bmp280, Tsl2591, Mcp23008, WiiClassicController, WiiNunchuk, Vcnl4010, Nau7802, Mpu9250, Bh1750, Bme280, Ds18b20, Ads1115, Adxl345, Lis3dh, TemperatureSensorBase, PortExpander, Veml6070, Tlv493d, Lsm303dlhc, ProximitySensor, PressureSensor, NesController, Lsm303dlhcMag, AccelerometerBase, GyroscopeBase, AmbientLightSensor, Mcp9700, MagnetometerBase, Lm75, Ak8975, Lsm303dlhcAccel, Mcp9808, and SuperNesController.

Property Documentation

◆ Centimeters

double Centimeters
get

Get the proximity reported by the sensor, in centimeters (cm)

◆ Inches

double Inches
get

Get the proximity reported by the sensor, in inches (in)

◆ Feet

double Feet
get

Get the proximity reported by the sensor, in feet (ft)

◆ Meters

double Meters
get

Get the proximity reported by the sensor, in meters (m)

◆ AutoUpdateWhenPropertyRead

bool AutoUpdateWhenPropertyRead
getsetinherited

Gets or sets whether reading from the sensor's properties should request updates from the sensor automatically (defaults to true).

By default, whenever you access one of the properties of this sensor, a new reading will be fetched. If this property is set to false, you must manually call the UpdateAsync() method to retrieve a new sensor reading.

This functionality enables more efficient sensor updates, since it allows you to intelligently control when data is gathered.


The documentation for this interface was generated from the following file: