Search found 5 matches

by Duramaximizer
Fri Mar 27, 2020 7:13 pm
Forum: MicroPython pyboard
Topic: Pin IRQ Debounce Messing with REPL
Replies: 9
Views: 103

Re: Pin IRQ Debounce Messing with REPL

Thanks for the replies. Unfortunately I don't have access to uasyncio on this board at the moment and would need my linux box to get it on. I tried jimmo's code. The debounce works flawlessly however when I use it for my callback I'm running into issues. I'm starting to think there's a problem with ...
by Duramaximizer
Fri Mar 27, 2020 12:19 am
Forum: MicroPython pyboard
Topic: Pin IRQ Debounce Messing with REPL
Replies: 9
Views: 103

Re: Pin IRQ Debounce Messing with REPL

Make a 1 ms timer and the callback will check the button value and add 1 to a global counter. Where do I run this timer? In the Pin interrupt routine? No, in a new interrupt routine driven by a timer. On Pyboard you can use machine.Timer(-1) to easily create a "soft" timer. You don't need a pin int...
by Duramaximizer
Thu Mar 26, 2020 1:38 pm
Forum: MicroPython pyboard
Topic: Pin IRQ Debounce Messing with REPL
Replies: 9
Views: 103

Re: Pin IRQ Debounce Messing with REPL

Thank you! I should be able to make that work like my debounce routine. Just need to adapt it to check for a series of 1's and then a release for a series of 0's before exiting. Make a 1 ms timer and the callback will check the button value and add 1 to a global counter. Where do I run this timer? I...
by Duramaximizer
Thu Mar 26, 2020 1:36 am
Forum: MicroPython pyboard
Topic: Pin IRQ Debounce Messing with REPL
Replies: 9
Views: 103

Re: Pin IRQ Debounce Messing with REPL

Thanks for replying! I do have some loops. The debounce routine appends switch.value() to a buffer until it is equal to another buffer of all 1's. Delaying 1 ms between switch.value() reads. I then do the same thing but looking for 0's to know the button has been pressed and released. I do limit the...
by Duramaximizer
Wed Mar 25, 2020 9:19 pm
Forum: MicroPython pyboard
Topic: Pin IRQ Debounce Messing with REPL
Replies: 9
Views: 103

Pin IRQ Debounce Messing with REPL

Hello, I have a push button on my board and have written a debounce routine to debounce the button press. The debounce routine is working great. I have a print statement in the debounce routine to show the button debounce has happened and it is working as expected. When I enable the interrupt and pr...