examples/hwapi/soft_pwm: Use Signal on()/off() methods.

Just one sample is updated with  on()/off() for now, there should be
remaining sample(s) showing .value() use (but more can be converted later,
as long as 1 or so good samples of .value() remains).
pull/2870/head
Paul Sokolovsky 2017-02-14 13:11:49 +03:00
rodzic adc80b8f84
commit dd00d0134b
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -14,10 +14,10 @@ def pwm_cycle(led, duty, cycles):
duty_off = 20 - duty
for i in range(cycles):
if duty:
led.value(1)
led.on()
utime.sleep_ms(duty)
if duty_off:
led.value(0)
led.off()
utime.sleep_ms(duty_off)