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).
This commit is contained in:
Paul Sokolovsky 2017-02-14 13:11:49 +03:00
parent adc80b8f84
commit dd00d0134b
1 changed files with 2 additions and 2 deletions

View File

@ -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)