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:
parent
adc80b8f84
commit
dd00d0134b
|
@ -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)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue