adafruit / Adafruit_CircuitPython_asyncio

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

examples: submitting ideas for example code #67

Closed johnnohj closed 5 months ago

johnnohj commented 5 months ago

Suggested changes prompted by issues #45 and #46 .

The asyncio_simpletest.py referenced in #45 seemed easily corrected with code from the excellent Cooperative Multitasking tutorial. For #46 , there still is no code posted by the original author almost a year later, so I submit a draft of code, asyncio_event_example.py, I worked up as an exercise for a larger project, and which I hope might be a useful model for anyone else intimidated or stymied by the readthedocs information.

dhalbert commented 5 months ago

Check out using pre-commit, which will let you check formatting issues before you push: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/check-your-code

johnnohj commented 5 months ago

Check out using pre-commit

I certainly will - I hope my amateurishness wasn't disruptive. That said, I think I've done all I can to satisfy the checks. The rest is beyond me. Further help and guidance would be greatly appreciated.

dhalbert commented 5 months ago

The remaining fixes look like comment indentation and using double quotes instead of single quotes. If you install pre-commit, it will take care of all this for you. The changes needed will be done automatically when the code is reformatted with black. See https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/black. Pre-commit runs black for you with the right settings.

johnnohj commented 5 months ago

Hey, cool beans! Navigating Git(Hub) as a novice wasn't the most enjoyable part of the process, but worth the bother to give back to the community in some small way. This ought to resolve issue #45 (I think?), and should at least help begin to answer #46 . Thank you, @dhalbert and @FoamyGuy !

Now, back to working on the driver for the VL53L1X sensor :)