
skipper_raspi_uart_test
Dependencies: mbed MPU6050_2 HMC5883L_4 SDFileSystem3
Diff: main.cpp
- Revision:
- 31:210cc32d3175
- Parent:
- 30:90252dc48c1a
- Child:
- 32:ab030832d180
--- a/main.cpp Tue Feb 26 14:24:44 2019 +0000 +++ b/main.cpp Wed Feb 27 02:39:44 2019 +0000 @@ -73,6 +73,7 @@ bool setupFlag = false; bool CameraDegFlag = false; bool jevoisFlag = true; +bool FocusFlag = false; int g_CameraDegCounter = 0; //カメラの回転数をカウント @@ -152,6 +153,11 @@ wait(5); pc.printf("start\r\n"); */ + + servoCameraPinto.pulsewidth_us(Focus_NEUTRAL-200); + wait(1); + servoCameraPinto.pulsewidth_us(Focus_NEUTRAL); + while(1) { if(jevoisFlag==true) NVIC_DisableIRQ(USART6_IRQn); else NVIC_DisableIRQ(USART2_IRQn); @@ -452,13 +458,15 @@ } void FocusAdjust(){ - servoCameraPinto.pulsewidth_us(Focus_NEUTRAL-200); - pc.printf("set\r\n"); - wait(1); - pc.printf("set2\r\n"); - servoCameraPinto.pulsewidth_us(Focus_NEUTRAL+Pint_speed); - pc.printf("check\r\n"); - wait(Pint_wait); + if(FocusFlag == false){ + servoCameraPinto.pulsewidth_us(Focus_NEUTRAL + 200); + wait(1); + FocusFlag = !FocusFlag; + }else{ + servoCameraPinto.pulsewidth_us(Focus_NEUTRAL - 200); + wait(1); + FocusFlag = !FocusFlag; + } servoCameraPinto.pulsewidth_us(Focus_NEUTRAL); return;