altb_pmic / Mbed 2 deprecated Test_optical_flow_PX4

Dependencies:   mbed

Revision:
12:19fe4f6a8b6b
Parent:
11:d367224f2194
Child:
13:89b65bfe6dda
--- a/main.cpp	Fri Sep 20 13:01:26 2019 +0000
+++ b/main.cpp	Sun Apr 05 08:47:25 2020 +0000
@@ -54,7 +54,7 @@
     dist = 0.0f;
 
     while(1) {
-        if(1) {
+        if(0) {
             if(PX4.update()) {
                 
                 /*
@@ -144,15 +144,17 @@
                 */
                 
                 // compare encoder and px4flow output, branch IndNaV with new PX4Flow driver functionality
-                pc.printf("%10i; %10.3f; %10.3f;", counter, velocity, 1.0f/dt);
-                pc.printf("%10.3f; %10.3f; %10.3f;", lsm_gyro[0], lsm_gyro[1], lsm_gyro[2]);
-                pc.printf("%10.3f; %10.3f; %10.3f; %10.4f;", PX4.avg_gyro_x(), PX4.avg_gyro_y(), PX4.avg_gyro_z(), PX4.int_timespan());
-                pc.printf("%10.3f; %10.3f; %4i;", PX4.avg_flowx(), PX4.avg_flowy(), PX4.avg_quality());
-                pc.printf("%10.3f; %10.3f; %4d; %4i;", PX4.update_fs(), PX4.readout_fs(), PX4.all_frame_count(), PX4.valid_frame_count());
+                pc.printf("%6i; %6.3f; %6.3f;", counter, velocity, 1.0f/dt);
+                pc.printf("%6.3f; %6.3f; %6.3f;", lsm_gyro[0], lsm_gyro[1], lsm_gyro[2]);
+                // pc.printf("%6i; %6.3f; %6.3i;", counter, 1.0f/dt);
+                pc.printf("%6.3f; %6.3f; %6.3f; %6.4f;", PX4.avg_gyro_x(), PX4.avg_gyro_y(), PX4.avg_gyro_z(), PX4.int_timespan());
+                pc.printf("%6.3f; %6.3f; %4i;", PX4.avg_flowx(), PX4.avg_flowy(), PX4.avg_quality());
+                pc.printf("%6.3f; %6.3f; %4d; %4i;", PX4.update_fs(), PX4.readout_fs(), PX4.all_frame_count(), PX4.valid_frame_count());
                 pc.printf("%4i", PX4.avg_scaled_quality());
                 pc.printf("\r\n");
                 
                 counter++;
+                // wait(0.0155); // 50 Hz
                 wait(0.0455); // 20 Hz USE 20 Hz!!!
                 // wait(0.0955); // 10 Hz
                 // wait(0.4955); // 2 Hz