コード例 #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
ファイル: doorbell.c プロジェクト: zhanpeic/nanopi
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;
}
コード例 #3
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
ファイル: doorbell.c プロジェクト: zhanpeic/nanopi
void doorbell_deinit() {
    sensorDeinit(devFD);
    PWMStop(BUZZERpin);
    unexportGPIOPin(LEDpin);
}
コード例 #6
0
void THmonitoring_deinit() {
	PWMStop(BUZZERpin);
	unexportGPIOPin(LEDpin);	
	LCD1602DeInit(devFD_LCD);
	dht11DeInit(devFD_DHT11);
}