ExtInt not working properly

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: ExtInt not working properly

Post by pythoncoder » Tue Jan 30, 2018 9:24 am

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.
Peter Hinch
Index to my micropython libraries.

nikhiledutech
Posts: 118
Joined: Wed Dec 27, 2017 8:52 am

Re: ExtInt not working properly

Post by nikhiledutech » Tue Jan 30, 2018 10:57 am

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

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: ExtInt not working properly

Post by pythoncoder » Tue Jan 30, 2018 1:52 pm

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.
Peter Hinch
Index to my micropython libraries.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: ExtInt not working properly

Post by dhylands » Tue Jan 30, 2018 6:15 pm

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.

nikhiledutech
Posts: 118
Joined: Wed Dec 27, 2017 8:52 am

Re: ExtInt not working properly

Post by nikhiledutech » Wed Jan 31, 2018 10:43 am

okay thanks Dhylands and Pythoncoder. I will revert, if i face any probs.

thankyou

hybotics
Posts: 33
Joined: Tue Apr 03, 2018 2:58 am
Contact:

Re: ExtInt not working properly

Post by hybotics » Thu Nov 15, 2018 6:10 am

Hi,

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
8-Dale

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: ExtInt not working properly

Post by pythoncoder » Thu Nov 15, 2018 9:11 am

The aswitch module is not part of MicroPython. It comes from this repo.
Peter Hinch
Index to my micropython libraries.

Post Reply