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:
- 4:7d2eae0115a2
- Parent:
- 3:79e62f9b13c8
- Child:
- 5:9cad4ce807b9
--- a/main.cpp Thu Jan 21 08:59:55 2021 +0000 +++ b/main.cpp Thu Jan 21 09:04:24 2021 +0000 @@ -28,12 +28,6 @@ ch2 = int(sbus.getData(2)); pc.printf("ch1 :%d\r\n", ch1); pc.printf("ch2 :%d\r\n", ch1); - if(abs(ch1-ch1_b) < 100){ - rc1 = (float)(map(ch1,368,1680,-1000,1000))/1000.0; - } - if(abs(ch2-ch2_b) < 100){ - rc2 = (float)(map(ch2,368,1680,-1000,1000))/1000.0; - } pc.printf("rc1 :%f\r\n", rc1); pc.printf("rc2 :%f\r\n", rc1); int pwmMax = 1800; @@ -66,7 +60,7 @@ servo2.period(0.020); Ticker timer_SBUS; Ticker timer_Gyro; - timer_SBUS.attach(interrupt_SBUS, 1.0); + timer_SBUS.attach(interrupt_SBUS, 0.020); timer_Gyro.attach(interrupt_Gyro, 0.1); while(1) {