Skip to content
Snippets Groups Projects
Commit dd00d013 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

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).
parent adc80b8f
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment