|
@@ -47,6 +47,11 @@ int main(void)
|
|
|
/* Initialize onBoard Hardware */
|
|
|
Board_Init();
|
|
|
|
|
|
+ //GPIO_SetPinMode(Servo_1_Port, Servo_1_Pin, GPIO_MODE_AFF);
|
|
|
+ Servo_1_CHNL = SERVO1_OPEN_VAL;
|
|
|
+ delay_ms(200);
|
|
|
+ //GPIO_SetPinMode(Servo_1_Port, Servo_1_Pin, GPIO_MODE_IN);
|
|
|
+ Servo_1_CHNL = SERVO_INIT_VAL;
|
|
|
/* if light is on, wait for off */
|
|
|
while (photo_Value <= PHOTO_LEVEL_OFF) {
|
|
|
//IWDG->KR = 0xAAAA;
|
|
@@ -62,14 +67,16 @@ int main(void)
|
|
|
__WFI();
|
|
|
}
|
|
|
/* open servo 1 */
|
|
|
+ //GPIO_SetPinMode(Servo_1_Port, Servo_1_Pin, GPIO_MODE_AFF);
|
|
|
Servo_1_CHNL = SERVO1_OPEN_VAL;
|
|
|
-
|
|
|
+ delay_ms(200);
|
|
|
/* wait for light off */
|
|
|
- while (photo_Value <= PHOTO_LEVEL_OFF) {
|
|
|
+ //while (photo_Value <= PHOTO_LEVEL_OFF) {
|
|
|
//IWDG->KR = 0xAAAA;
|
|
|
- __WFI();
|
|
|
- }
|
|
|
+ // __WFI();
|
|
|
+ //}
|
|
|
/* close servo 1 */
|
|
|
+ //GPIO_SetPinMode(Servo_1_Port, Servo_1_Pin, GPIO_MODE_IN);
|
|
|
Servo_1_CHNL = SERVO_INIT_VAL;
|
|
|
#endif
|
|
|
|