mirror of
https://github.com/okalachev/flix.git
synced 2025-08-17 17:16:10 +00:00
Cleanup, use printf
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user