void LightDown (void){ uint8_t i; for (i=PWMGet(); i>0; i--){ PWMSet (i); if (i<PWMStepOver) Wait (PWMSlowDelay); else Wait (PWMQuickDelay); } PWMStop(); }
int doorbell_close() { if(setGPIOValue(LEDpin, GPIO_LOW) == -1) { printf("setGPIOValue(%d) failed\n", LEDpin); return -1; } if(PWMStop(BUZZERpin) == -1) { printf("Fail to stop PWM\n"); return -1; } return 0; }
int THmonitoring_noalart() { if(setGPIOValue(LEDpin, GPIO_LOW) == -1) { printf("setGPIOValue(%d) failed\n", LEDpin); return -1; } if(PWMStop(BUZZERpin) == -1) { printf("Fail to stop PWM\n"); return -1; } return 0; }
void LiveInLight (void){ PORTB &= ~(1<<LedPin); // Light-up LED PWMStop(); while (1){ EnableInput (); DeepSleep(); DisableInput (); if (Valto != None) { EventHandler (); // if key pressed then shutdown if (Valto==KeyPressed) break; } } PWMStart(250); PORTB |= (1<<LedPin); // Shutdown LED }
void doorbell_deinit() { sensorDeinit(devFD); PWMStop(BUZZERpin); unexportGPIOPin(LEDpin); }
void THmonitoring_deinit() { PWMStop(BUZZERpin); unexportGPIOPin(LEDpin); LCD1602DeInit(devFD_LCD); dht11DeInit(devFD_DHT11); }