mirror of
https://github.com/okalachev/flix.git
synced 2025-07-27 09:39:33 +00:00
Correctly restore IMU settings after accel calibration
This commit is contained in:
parent
32f29dc1a4
commit
f782f647cb
@ -62,9 +62,10 @@ void calibrateGyro() {
|
|||||||
|
|
||||||
void calibrateAccel() {
|
void calibrateAccel() {
|
||||||
Serial.println("Calibrating accelerometer");
|
Serial.println("Calibrating accelerometer");
|
||||||
IMU.setAccelRange(IMU.ACCEL_RANGE_2G);
|
IMU.setAccelRange(IMU.ACCEL_RANGE_2G); // the most sensitive mode
|
||||||
IMU.setDlpfBandwidth(IMU.DLPF_BANDWIDTH_20HZ);
|
IMU.setDlpfBandwidth(IMU.DLPF_BANDWIDTH_20HZ);
|
||||||
IMU.setSrd(19);
|
IMU.setSrd(19);
|
||||||
|
|
||||||
Serial.setTimeout(60000);
|
Serial.setTimeout(60000);
|
||||||
Serial.print("Place level [enter] "); Serial.readStringUntil('\n');
|
Serial.print("Place level [enter] "); Serial.readStringUntil('\n');
|
||||||
calibrateAccelOnce();
|
calibrateAccelOnce();
|
||||||
@ -78,10 +79,9 @@ void calibrateAccel() {
|
|||||||
calibrateAccelOnce();
|
calibrateAccelOnce();
|
||||||
Serial.print("Place upside down [enter] "); Serial.readStringUntil('\n');
|
Serial.print("Place upside down [enter] "); Serial.readStringUntil('\n');
|
||||||
calibrateAccelOnce();
|
calibrateAccelOnce();
|
||||||
|
|
||||||
printIMUCal();
|
printIMUCal();
|
||||||
IMU.setAccelRange(IMU.ACCEL_RANGE_16G);
|
configureIMU();
|
||||||
IMU.setDlpfBandwidth(IMU.DLPF_BANDWIDTH_184HZ);
|
|
||||||
IMU.setSrd(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void calibrateAccelOnce() {
|
void calibrateAccelOnce() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user