Eigen Revision
Dependencies: mbed LPS25HB_I2C LSM9DS1 PIDcontroller Autopilot_Eigen LoopTicker GPSUBX_UART_Eigen SBUS_without_mainfile MedianFilter Eigen UsaPack solaESKF_Eigen Vector3 CalibrateMagneto FastPWM
Diff: main.cpp
- Revision:
- 12:06891de5c601
- Parent:
- 11:ec79564cf265
diff -r ec79564cf265 -r 06891de5c601 main.cpp --- a/main.cpp Thu Jan 28 03:32:13 2021 +0000 +++ b/main.cpp Thu Jan 28 03:40:37 2021 +0000 @@ -27,14 +27,14 @@ { ch1 = int(sbus.getData(1)); ch2 = int(sbus.getData(2)); - pc.printf("ch1 :%d ", ch1); - pc.printf("ch2 :%d ", ch2); + pc.printf("ch1 :%6d ", ch1); + pc.printf("ch2 :%6d ", ch2); float LP_rc = 0.65f; float LP_rc3 = 0.15f; rc1 = LP_rc*float(map(ch1,368,1680,-1000,1000))/1000.0f+(1.0f-LP_rc)*rc1; rc2 = LP_rc*float(map(ch2,368,1680,-1000,1000))/1000.0f+(1.0f-LP_rc)*rc2; - pc.printf("rc1 :%f ", rc1); - pc.printf("rc2 :%f ", rc1); + pc.printf("rc1 :%12f ", rc1); + pc.printf("rc2 :%12f ", rc1); int pwmMax = 1800; int pwmMin = 1200; out1 = map((int)(rc1*2000.0f),-2000,2000,pwmMin,pwmMax); @@ -44,8 +44,8 @@ if(out2<pwmMin){out2 = pwmMin;}; if(out2>pwmMax){out2 = pwmMax;}; - pc.printf("out1:%d ", out1); - pc.printf("out2:%d\r\n", out2); + pc.printf("out1:%6d ", out1); + pc.printf("out2:%6d\r\n", out2); servo1.pulsewidth_us(out1); servo2.pulsewidth_us(out2); }