Go Down

Topic: Simple Interrupt (Read 1 time) previous topic - next topic


When you say "configure the pin a little bit"  what do you mean.  I've tried writing HIGH to it after configuring it to be an input pin, which as far as I can tell should enable the internal pullup resistor.  I changed the interrupt to trigger on CHANGE, which should mean that the button becomes low, and changes the state.


I changed my circuit to not use the +5v output on the board, powering the switch with 4 AA bateries, and now with CHANGE as the trigger,  things seem to work better.


Aug 27, 2010, 01:50 am Last Edit: Aug 27, 2010, 01:51 am by mpeuser Reason: 1
(1) You have to use a pull-up or pull-down. Please understand this.
(2) If you do not want to use an external resistor, there is only the pull-up solution.
(3) Hence the button must be connected to ground, what is called "active low" by us nit-wits.
(4) So to catch this with an interrupt, you have to look for a falling edge..

Yes, I think this might work..


And then the mighty deboucing kicks in, or the mechanical vibration of the switch will trigger alot of interrupts every time that you press the button.


Why not? We don't know what the program is assumed to do. Maybe it's a "bounce-counter"?

Go Up