示例#1
0
文件: MainUnit.c 项目: Kreyl/Calmari
void LightDown (void){
	uint8_t i;
	for (i=PWMGet(); i>0; i--){
		PWMSet (i);
		if (i<PWMStepOver) Wait (PWMSlowDelay); 
		else Wait (PWMQuickDelay);
	}	
	PWMStop();
}
示例#2
0
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;
}
示例#4
0
文件: MainUnit.c 项目: Kreyl/Calmari
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
}
示例#5
0
void doorbell_deinit() {
    sensorDeinit(devFD);
    PWMStop(BUZZERpin);
    unexportGPIOPin(LEDpin);
}
void THmonitoring_deinit() {
	PWMStop(BUZZERpin);
	unexportGPIOPin(LEDpin);	
	LCD1602DeInit(devFD_LCD);
	dht11DeInit(devFD_DHT11);
}