---vl6180dr
This commit is contained in:
16
App/app.cpp
16
App/app.cpp
@@ -80,21 +80,23 @@ uint8_t updateMode = 0;
|
||||
|
||||
void zummerOff (void)
|
||||
{
|
||||
HAL_TIM_Base_Stop(&htim3);
|
||||
HAL_TIM_PWM_Stop(&htim3, TIM_CHANNEL_2);
|
||||
HAL_TIM_Base_Stop(&htimZummer);
|
||||
HAL_TIM_PWM_Stop(&htimZummer, TIM_CHANNEL_2);
|
||||
}
|
||||
void zummerOn (void)
|
||||
{
|
||||
HAL_TIM_Base_Start(&htim3);
|
||||
HAL_TIM_PWM_Start(&htim3, TIM_CHANNEL_2);
|
||||
HAL_TIM_Base_Start(&htimZummer);
|
||||
HAL_TIM_PWM_Start(&htimZummer, TIM_CHANNEL_2);
|
||||
}
|
||||
void lightingOn (void)
|
||||
{
|
||||
HAL_GPIO_WritePin(LIGHTING_EN_GPIO_Port, LIGHTING_EN_Pin, GPIO_PIN_SET);
|
||||
HAL_TIM_Base_Start(&htimLighitng);
|
||||
HAL_TIM_PWM_Start(&htimLighitng, TIM_CHANNEL_1);
|
||||
}
|
||||
void lightingOff (void)
|
||||
{
|
||||
HAL_GPIO_WritePin(LIGHTING_EN_GPIO_Port, LIGHTING_EN_Pin, GPIO_PIN_RESET);
|
||||
HAL_TIM_Base_Stop(&htimLighitng);
|
||||
HAL_TIM_PWM_Stop(&htimLighitng, TIM_CHANNEL_1);
|
||||
}
|
||||
|
||||
uint8_t proximityCompleteMessure = 0;
|
||||
@@ -146,7 +148,7 @@ void AppTask(void)
|
||||
{
|
||||
|
||||
}
|
||||
if (HAL_GetTick() - lightStartMs >= 10000)
|
||||
if (HAL_GetTick() - lightStartMs >= 10000 && lightStartMs > 0)
|
||||
{
|
||||
lightStartMs = 0;
|
||||
lightingOff();
|
||||
|
||||
Reference in New Issue
Block a user