uasyncio: Example of the the use of aswitch classes
uasyncio: Example of the the use of aswitch classes
I am learning about uasyncio, I am working through the examples in micropython-async-master, and am looking at the classes in aswitch.py, These look really useful but I would really like to see an example of their use to help me understand how they work. Can someone point me in the direction of an example, something on git hub for example.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: uasyncio: Example of the the use of aswitch classes
The README section 1 has a link to Asynchronous Device Drivers which documents the aswitch class. A test program astests.py is provided which demonstrates the driver on Pyboard. Its use is documented in section 4.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: uasyncio: Example of the the use of aswitch classes
Thanks Peter. Bit embarrassing really, I had skimmed through that file but was put off running it because I realised I would have to get my soldering iron out, I didn’t study it thoroughly enough to realise it imported aswitch.... off to get my soldering iron.....
Re: uasyncio: Example of the the use of aswitch classes
... actually I dont think I need to get my soldering iron out to run this code! I have just realised that with these new fangled microcontrollers like the STM32 they actually have the pull up and pull down resistors built in! so you don’t have to solder up a little circuit with a switch and a 10k pull up resistor. If you are careful, I suppose you can just short the pin to ground to test the circuit
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: uasyncio: Example of the the use of aswitch classes
Indeed. For quick tests I have a Pyboard in the official aluminium case. A lot can be done with a handful of pin-pin jumpers.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.