@@ -55,7 +55,7 @@ void setup() {
5555 lsm6dsoxSensor.begin ();
5656
5757 // Enable accelerometer and gyroscope, and check success
58- if (lsm6dsoxSensor.Enable_X () == LSM6DSOX_OK && lsm6dsoxSensor.Enable_X () == LSM6DSOX_OK) {
58+ if (lsm6dsoxSensor.Enable_X () == LSM6DSOX_OK && lsm6dsoxSensor.Enable_G () == LSM6DSOX_OK) {
5959 Serial.println (" Success enabling accelero and gyro" );
6060 } else {
6161 Serial.println (" Error enabling accelero and gyro" );
@@ -95,7 +95,7 @@ void loop() {
9595 if (acceleroStatus == 1 ) { // Status == 1 means a new data is available
9696 int32_t acceleration[3 ];
9797 lsm6dsoxSensor.Get_X_Axes (acceleration);
98- // Plot data for each axe in mg
98+ // Plot data for each axis in mg
9999 Serial.print (" AccelerationX=" ); Serial.print (acceleration[0 ]); Serial.print (" mg, AccelerationY=" ); Serial.print (acceleration[1 ]); Serial.print (" mg, AccelerationZ=" ); Serial.print (acceleration[2 ]); Serial.println (" mg" );
100100 }
101101
@@ -104,8 +104,8 @@ void loop() {
104104 lsm6dsoxSensor.Get_G_DRDY_Status (&gyroStatus);
105105 if (gyroStatus == 1 ) { // Status == 1 means a new data is available
106106 int32_t rotation[3 ];
107- lsm6dsoxSensor.Get_X_Axes (rotation);
108- // Plot data for each axe in milli degres per second
107+ lsm6dsoxSensor.Get_G_Axes (rotation);
108+ // Plot data for each axis in milli degrees per second
109109 Serial.print (" RotationX=" ); Serial.print (rotation[0 ]); Serial.print (" mdps, RotationY=" ); Serial.print (rotation[1 ]); Serial.print (" mdps, RotationZ=" ); Serial.print (rotation[2 ]); Serial.println (" mdps" );
110110 }
111111
0 commit comments