I've now updated asyn.py to produce a better error message if uasyncio is out of date. Thanks for the feedback.
Your while True: loop will take 2 seconds per iteration which probably accounts for the slow response.
However I would consider using aswitch.Switch. There is no need to use interrupts to handle switches, and the Switch class handles debouncing and callbacks. Using that class would simplify your code considerably. A callback on each switch would update the LCD with the message appropriate to that switch.
ExtInt not working properly
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: ExtInt not working properly
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
-
- Posts: 118
- Joined: Wed Dec 27, 2017 8:52 am
Re: ExtInt not working properly
Okay Sir. I will try that too.
Sir do you know how i can change pin configurations for stm board. Like if we see in stm32f407 disc board, UART1 pin are utilized for performing other functions. So how can i change the pin configuratuions.
Do i need to fork the micropython , then change the configuration file for stm than compile it or is their some any method ?
Thanks
Sir do you know how i can change pin configurations for stm board. Like if we see in stm32f407 disc board, UART1 pin are utilized for performing other functions. So how can i change the pin configuratuions.
Do i need to fork the micropython , then change the configuration file for stm than compile it or is their some any method ?
Thanks
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: ExtInt not working properly
This is outside my experience but you do need to fork/clone, modify and compile. You only need to fork if you want to raise a PR to include your board definition in the official build - otherwise cloning the official repo to your machine and adapting it locally will suffice.
For a start on how to do it look in ports/stm32/boards.
For a start on how to do it look in ports/stm32/boards.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: ExtInt not working properly
I've got a collection of board files here: https://github.com/dhylands/wiki/wiki/M ... oard-files
If you look at the README.md file in say the 1BITSY one: https://github.com/dhylands/1BITSY it gives the steps to install the board files into a cloned micropython repository and how to build/deploy.
To support a new board, you'll need to create a similar set of files and follow a similar set of instructions.
If you look at the README.md file in say the 1BITSY one: https://github.com/dhylands/1BITSY it gives the steps to install the board files into a cloned micropython repository and how to build/deploy.
To support a new board, you'll need to create a similar set of files and follow a similar set of instructions.
-
- Posts: 118
- Joined: Wed Dec 27, 2017 8:52 am
Re: ExtInt not working properly
okay thanks Dhylands and Pythoncoder. I will revert, if i face any probs.
thankyou
thankyou
Re: ExtInt not working properly
Hi,
What version of Micropython are you guys working with? I do not have an aswitch module.
8-Dale
What version of Micropython are you guys working with? I do not have an aswitch module.
Code: Select all
PYB: sync filesystems
PYB: soft reboot
Traceback (most recent call last):
File "main.py", line 1, in <module>
ImportError: no module named 'aswitch'
MicroPython v1.9.4-479-g828f771e3 on 2018-08-21; PYBv1.1 with STM32F405RG
Type "help()" for more information.
>>> help('modules')
__main__ heapq re uio
_onewire io select ujson
_thread json socket umachine
array lcd160cr stm uos
binascii lcd160cr_test struct urandom
builtins machine sys ure
cmath math time uselect
collections micropython ubinascii usocket
dht network ucollections ustruct
errno onewire uctypes utime
framebuf os uerrno utimeq
gc pyb uhashlib uzlib
hashlib random uheapq zlib
Plus any modules on the filesystem
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: ExtInt not working properly
The aswitch module is not part of MicroPython. It comes from this repo.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.