Skip to content

Commit 05579e5

Browse files
committed
Simplify aledflash demo.
1 parent 1341eac commit 05579e5

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

v3/as_demos/aledflash.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
import pyb
88
import uasyncio as asyncio
99

10-
async def killer(duration):
11-
await asyncio.sleep(duration)
12-
1310
async def toggle(objLED, time_ms):
1411
while True:
1512
await asyncio.sleep_ms(time_ms)
@@ -23,7 +20,7 @@ async def main(duration):
2320
for x, led in enumerate(leds): # Create a task for each LED
2421
t = int((0.2 + x/2) * 1000)
2522
asyncio.create_task(toggle(leds[x], t))
26-
asyncio.run(killer(duration))
23+
await asyncio.sleep(duration)
2724

2825
def test(duration=10):
2926
try:

0 commit comments

Comments
 (0)