Skip to content

Commit d975bb1

Browse files
jimmodpgeorge
authored andcommitted
examples/hwapi: Rename uasyncio to asyncio.
This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <[email protected]>
1 parent 9092909 commit d975bb1

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

examples/hwapi/soft_pwm2_uasyncio.py renamed to examples/hwapi/soft_pwm2_asyncio.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Like soft_pwm_uasyncio.py, but fading 2 LEDs with different phase.
1+
# Like soft_pwm_asyncio.py, but fading 2 LEDs with different phase.
22
# Also see original soft_pwm.py.
3-
import uasyncio
3+
import asyncio
44
from hwconfig import LED, LED2
55

66

@@ -9,10 +9,10 @@ async def pwm_cycle(led, duty, cycles):
99
for i in range(cycles):
1010
if duty:
1111
led.value(1)
12-
await uasyncio.sleep_ms(duty)
12+
await asyncio.sleep_ms(duty)
1313
if duty_off:
1414
led.value(0)
15-
await uasyncio.sleep_ms(duty_off)
15+
await asyncio.sleep_ms(duty_off)
1616

1717

1818
async def fade_in_out(LED):
@@ -25,7 +25,7 @@ async def fade_in_out(LED):
2525
await pwm_cycle(LED, i, 2)
2626

2727

28-
loop = uasyncio.get_event_loop()
28+
loop = asyncio.get_event_loop()
2929
loop.create_task(fade_in_out(LED))
3030
loop.call_later_ms(800, fade_in_out(LED2))
3131
loop.run_forever()

examples/hwapi/soft_pwm_uasyncio.py renamed to examples/hwapi/soft_pwm_asyncio.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# See original soft_pwm.py for detailed comments.
2-
import uasyncio
2+
import asyncio
33
from hwconfig import LED
44

55

@@ -8,10 +8,10 @@ async def pwm_cycle(led, duty, cycles):
88
for i in range(cycles):
99
if duty:
1010
led.value(1)
11-
await uasyncio.sleep_ms(duty)
11+
await asyncio.sleep_ms(duty)
1212
if duty_off:
1313
led.value(0)
14-
await uasyncio.sleep_ms(duty_off)
14+
await asyncio.sleep_ms(duty_off)
1515

1616

1717
async def fade_in_out(LED):
@@ -24,5 +24,5 @@ async def fade_in_out(LED):
2424
await pwm_cycle(LED, i, 2)
2525

2626

27-
loop = uasyncio.get_event_loop()
27+
loop = asyncio.get_event_loop()
2828
loop.run_until_complete(fade_in_out(LED))

0 commit comments

Comments
 (0)