Treehopper C# API
IAccelerometer Interface Reference

Three-axis accelerometer sensor More...

Inheritance diagram for IAccelerometer:
IPollable WiiNunchuk AccelerometerBase Bno055 Mpu6050 Adxl345 Lis3dh Lsm303dlhcAccel Mpu9250

Public Member Functions

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

Properties

Vector3 Accelerometer [get]
 The three-axis acceleration reading, in g. 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...
 

Detailed Description

Three-axis accelerometer sensor

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

◆ Accelerometer

Vector3 Accelerometer
get

The three-axis acceleration reading, in g.

◆ 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: