adafruit / Adafruit_CircuitPython_asyncio

CIrcuitPython subset of CPython asyncio library
MIT License
28 stars 16 forks source link

asyncio syntax error #14

Closed gommdt closed 2 years ago

gommdt commented 2 years ago

While following the asyncio tutorial I am getting a syntax error. I am using the"QT Py Haxpress" uf2.

async def read_color(curent_color): <------ SyntaxError: invalid syntax while True: r, g, b, c = apds.color_data print("Red: {0}, Green: {1}, Blue: {2}, Clear: {3}".format(r, g, b, c)) curent_color.value = (r, g, b) await asyncio.sleep(0.2)

in the REPL:

'>>>' import asyncio Traceback (most recent call last): File "", line 1, in File "asyncio/init.py", line 14, in File "asyncio/core.py", line 15, in ImportError: no module named 'select' code_py.zip

dhalbert commented 2 years ago

The QT Py SAMD21 board, and all SAMD21 boards, do not have enough firmware space for async/await support. Sorry! Do you have another board, like an RP2040?

gommdt commented 2 years ago

Totally do. I will try them out. Thought I would be safe with the attached flash chip.

gommdt commented 2 years ago

Works like a charm on the QTPY RP2040. Thanks for the help!!!!