Skip to content

Commit 96f3d9a

Browse files
authored
Update asyncio_event_example.py
Corrections to code made based on test results.
1 parent 8e3a77f commit 96f3d9a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/asyncio_event_example.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
# several copies of the functions 'blink', 'input_poll', or 'state'
77
# should be straightforward with changes to names and objects.
88

9+
import asyncio
910
import board
10-
import time
1111
import adafruit_ticks
1212
import digitalio
1313
from adafruit_debouncer import Debouncer
1414
import neopixel
15-
import asyncio
15+
1616

1717
# Import library modules, as is tradition
1818

@@ -34,7 +34,7 @@
3434
# Define the various colors according to preference and set them into
3535
# a dictionary for later retrieval. (Blue is not used in this code.)
3636

37-
class color:
37+
class Color:
3838
def __init__(self, initial_value):
3939
self.value = initial_value
4040

@@ -86,7 +86,7 @@ async def state(swapper, color):
8686

8787
async def main():
8888

89-
color.value = 1
89+
color = Color(1)
9090
COLORS.get(color)
9191

9292
# Sets the color the led will first show on start

0 commit comments

Comments
 (0)