Go Down

Topic: Buttons, interrupts and de-bouncing (Read 2550 times) previous topic - next topic

dhenry

Quote
So does it make sense to always use interrupts


No. Nor does it make sense to always use polling.

As a matter of fact, it doesn't make sense to always do anything.

MrGlasspoole

Ok, more confused :smiley-roll:
I found this from Ladyada and she writes:
"To change the pins or number of buttons, just put them in the array called "buttons" and the rest of the code will automatically adjust."
http://www.adafruit.com/blog/2009/10/20/example-code-for-multi-button-checker-with-debouncing/
The second sketch uses interrupts. But she is using analog inputs and how can i just ad buttons if i can't just
use every input pin as interrupt??

This sketch also says: "which pin to use for reading the sensor? can use any pin!"
https://raw.github.com/adafruit/Adafruit-Flow-Meter/master/Adafruit_FlowMeter.pde

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy