I'm having a little difficulty managing my external interupts on a bike counter project. I use a reed switch to count the number of rotations of the wheel with a external interupt on counter 0.
I followed this post :
https://techtutorialsx.com/2017/10/08/e ... nterrupts/
I'm no expert but i already used external interrupts on arduino nano so i think i understand most of this code.
My problem is that the interrupt is triggered to many times and it "spams" the console 3 or 4 times every time i close the switch.
i use a different pin and change the IRQ to IRQ_RISING. The IRQ_RISING works better in my case the IRQ_FALLING triggered even more interrupts.
Code: Select all
reed = machine.Pin(39, machine.Pin.IN, machine.Pin.PULL_UP) reed.irq(trigger=machine.Pin.IRQ_RISING, handler=callback)
So i have many questions on how to solve this.
Can i use the same counter to add a second interrupt that checks if for a low input before handling the counter ?
Is this solvable by adding a delay/sleep to the interrupt so that it waits for a minimum of time before being re-triggered ?
Is another Pin more suitable ?