示例#1
0
void doPWM()
{
	if(countUp){
		i++;
		if(i == 100){
			countUp = false;
			countDown = true;
		}
	}
	else{
		i--;
		if(i == 0){
			countUp = true;
			countDown = false;
		}
	}
	Serial.println(i);
	ledPWM.analogWrite(LED_PIN, i);
}
示例#2
0
void init()
{
	ledPWM.initialize();
	procTimer.initializeMs(10, doPWM).start();
}
示例#3
0
文件: PWM.cpp 项目: DimSun75/Sming
void noAnalogWrite(uint8_t pin)
{
	EspPWM.noAnalogWrite(pin);
}
示例#4
0
文件: PWM.cpp 项目: DimSun75/Sming
void analogWrite(uint8_t pin, int duty)
{
	EspPWM.initialize();
	EspPWM.analogWrite(pin, duty);
}