Cleanup, use printf

This commit is contained in:
Oleg Kalachev 2023-05-24 11:22:59 +03:00
parent 17edd0ee00
commit 1125335b16
3 changed files with 1 additions and 20 deletions

View File

@ -17,7 +17,7 @@ void setupIMU()
auto status = IMU.begin();
if (status < 0) {
while (true) {
Serial.print("IMU begin error: "); Serial.println(status);
Serial.printf("IMU begin error: %d\n", status);
delay(1000);
}
}

View File

@ -26,21 +26,3 @@ void step() {
stepsPerSecondCurrentLast = time;
}
}
void _step() {
steps++;
auto currentStepTime = micros();
if (stepTime == 0) {
stepTime = currentStepTime;
}
dt = (currentStepTime - stepTime) / 1000000.0;
stepTime = currentStepTime;
// compute steps per second, TODO: move to func
stepsPerSecondCurrent++;
if (stepTime - stepsPerSecondCurrentLast >= 1000000) {
stepsPerSecond = stepsPerSecondCurrent;
stepsPerSecondCurrent = 0;
stepsPerSecondCurrentLast = stepTime;
}
}

View File

@ -30,7 +30,6 @@ Quaternion attitude;
void control();
void interpretRC();
static void controlAttitude();
static void controlAttitudeAlter();
static void controlManual();
static void controlRate();
void desaturate(float& a, float& b, float& c, float& d);