Page 1 of 1
uasyncio: Example of the the use of aswitch classes
Posted: Mon Mar 19, 2018 8:38 pm
by Jim.S
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.
Re: uasyncio: Example of the the use of aswitch classes
Posted: Tue Mar 20, 2018 5:12 am
by pythoncoder
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.
Re: uasyncio: Example of the the use of aswitch classes
Posted: Tue Mar 20, 2018 8:11 pm
by Jim.S
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
Posted: Sat Mar 24, 2018 7:46 pm
by Jim.S
... 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
Re: uasyncio: Example of the the use of aswitch classes
Posted: Sun Mar 25, 2018 10:51 am
by pythoncoder
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.