adxl345
Connect ADXL345, ADXL343, ADXL344, or ADXL346 sensor on Raspberry Pi hardware I2C bus
Since R2023a
Add-On Required: This feature requires the MATLAB Support Package for Raspberry Pi Hardware add-on.
Description
The adxl345
object reads linear acceleration using the ADXL345,
ADXL343, ADXL344, or ADXL346 sensor connected to the I2C bus of the hardware. The ADXL34x
family of accelerometers are used to read acceleration in all three dimensions. Attach an
ADXL34x sensor to the I2C pins on the hardware. You can read the data from your sensor in
MATLAB® using the Object Functions.
Creation
Description
creates a sensor object with default property values.accelSensor
= adxl345(mypi
)
creates a sensor object with properties using one or more accelSensor
= adxl345(mypi
,Name,Value
)Name,Value
pair arguments.
Input Arguments
Object Functions
readAcceleration | Read one sample of acceleration from sensor |
Examples
Extended Capabilities
Version History
Introduced in R2023a