SDの設定が反映されるように修正
Dependencies: mbed MPU6050_2 HMC5883L_2 SDFileSystem3
Diff: main.cpp
- Revision:
- 15:1519fccfcae3
- Parent:
- 14:90e9b44eb819
- Child:
- 16:26cee2aaf61d
diff -r 90e9b44eb819 -r 1519fccfcae3 main.cpp --- a/main.cpp Tue Feb 12 13:31:33 2019 +0000 +++ b/main.cpp Tue Feb 12 13:39:26 2019 +0000 @@ -112,7 +112,7 @@ //MPU_check setup(); - servoCameradeg.pulsewidth_us(1400); + servoCameradeg.pulsewidth_us(camera_deg_A); // シリアル通信受信の割り込みイベント登録 pc.attach(getSF_Serial_jevois, Serial::RxIrq); @@ -272,10 +272,15 @@ if(g_landingcommand!='N') return; if(!CameraDegFlag){ - servoCameradeg.pulsewidth_us(1800); + for(int i=0; i<camera_deg_B-camera_deg_A;i=i+10){ + servoCameradeg.pulsewidth_us(camera_deg_A+10); + wait_ms(20); + } CameraDegFlag=!CameraDegFlag; }else{ - servoCameradeg.pulsewidth_us(1400); + for(int i=0; i<camera_deg_B-camera_deg_A;i=i+10){ + servoCameradeg.pulsewidth_us(camera_deg_A-10); + } CameraDegFlag = !CameraDegFlag; } @@ -298,17 +303,17 @@ } void FocusAdjust(){ - servoCameraPinto.pulsewidth_us(Focus_NEUTRAL-200); - pc.printf("set\r\n"); + servoCameraPinto.pulsewidth_us(focus_NEUTRAL-200); + //pc.printf("set\r\n"); wait(1); - servoCameraPinto.pulsewidth_us(Focus_NEUTRAL+30); - pc.printf("check\r\n"); - wait(3); - servoCameraPinto.pulsewidth_us(Focus_NEUTRAL); + servoCameraPinto.pulsewidth_us(focus_NEUTRAL+20); + //pc.printf("check\r\n"); + wait(4); + servoCameraPinto.pulsewidth_us(focus_NEUTRAL); return; -} +} void getSF_Serial_jevois(){