This commit is contained in:
tkl 2016-08-09 12:32:19 +02:00
parent b80a44a4d9
commit 461f219b08

View File

@ -74,11 +74,16 @@ static void th_func(void *arg)
unsigned int duty = 0; unsigned int duty = 0;
pwm_open(&pwm_ch4); pwm_open(&pwm_ch4);
while(1) { while(1) {
pwm_set_duty_cycle(&pwm_ch4, duty); while(duty < 100) {
sleep_ms(100); pwm_set_duty_cycle(&pwm_ch4, duty);
duty++; sleep_ms(10);
if(duty > 100) duty++;
duty = 0; }
while(duty > 0) {
pwm_set_duty_cycle(&pwm_ch4, duty);
sleep_ms(10);
duty--;
}
} }
} }