Making an ESP32-based quadcopter from scratch
Python arduinoautopilotcontrol-theorydroneesp32flight-controlflight-controllermavlinkquadcopterquadcopter-firmwareuav
Cleanup, use printf
Oleg Kalachev1125335b16a7
diff --git a/flix/imu.ino b/flix/imu.inoindex 763fe8e..8bddc6b 100644--- a/flix/imu.ino+++ b/flix/imu.ino@@ -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);}}diff --git a/flix/time.ino b/flix/time.inoindex 5830ea1..b15a8fd 100644--- a/flix/time.ino+++ b/flix/time.ino@@ -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;- }-}diff --git a/gazebo/flix.h b/gazebo/flix.hindex 6f90636..7f4c4dd 100644--- a/gazebo/flix.h+++ b/gazebo/flix.h@@ -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);