IMU::getRawAccelX()
Get X-axis acceleration value of gyroscope
Return Values
Parameters
Type
Description
number
float
X-axis acceleration inm/S²
Example
Use the uKit Explore v2 board to get the XYZ acceleration of the gyroscope every 400ms.
#include "uKitExplore2.h"
void setup() {
Initialization();
IMU::init();
}
void loop() {
IMU::read();
Serial.print("xAccel:");
Serial.print(IMU::getRawAccelX());
Serial.print(",yAccel:");
Serial.print(IMU::getRawAccelY());
Serial.print(",zAccel:");
Serial.println(IMU::getRawAccelZ());
delay(400);
}
Last updated
Was this helpful?