Analog Devices ADXL345 three-axis accelerometer
More...
|
| Adxl345 (I2C i2c, bool altAddressPin=false, int rate=100) |
| Construct a new Analog Devices ADXL345. More...
|
|
override async Task | UpdateAsync () |
| Requests a reading from the sensor and updates its data properties with the gathered values. More...
|
|
|
Vector3 | Accelerometer [get] |
| Gets a vector with the three-dimensional acceleration data, in g. More...
|
|
bool | AutoUpdateWhenPropertyRead = true [get, set] |
| Gets or sets whether reading from the sensor's properties should request updates from the sensor automatically (defaults to true). More...
|
|
Analog Devices ADXL345 three-axis accelerometer
◆ Adxl345()
Adxl345 |
( |
I2C |
i2c, |
|
|
bool |
altAddressPin = false , |
|
|
int |
rate = 100 |
|
) |
| |
Construct a new Analog Devices ADXL345.
- Parameters
-
i2c | The I2C bus to use. |
altAddressPin | The state of the address pin. |
rate | The rate, in kHz, to use. |
◆ ProbeAsync()
static async Task<IList<Adxl345> > ProbeAsync |
( |
I2C |
i2c, |
|
|
int |
rate = 100 |
|
) |
| |
|
static |
◆ UpdateAsync()
override async Task UpdateAsync |
( |
| ) |
|
|
virtual |
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).
Implements AccelerometerBase.
◆ RaisePropertyChanged() [1/2]
void RaisePropertyChanged |
( |
object |
sender | ) |
|
|
protectedinherited |
◆ RaisePropertyChanged() [2/2]
void RaisePropertyChanged |
( |
object |
sender, |
|
|
string |
property |
|
) |
| |
|
protectedinherited |
◆ _accelerometer
◆ Accelerometer
Gets a vector with the three-dimensional acceleration data, in g.
\(1\, \text{g} = 9.8\, \text{m}/\text{s}^2\)
◆ AutoUpdateWhenPropertyRead
bool AutoUpdateWhenPropertyRead = true |
|
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.
◆ PropertyChanged
PropertyChangedEventHandler PropertyChanged |
|
inherited |
The documentation for this class was generated from the following file:
- F:/Git/treehopper-sdk/NET/API/Treehopper.Libraries/Sensors/Inertial/Adxl345.cs