Problem PCintPort::attachInterrupt with Arduino LCD KeyPad Shield

221 views
Skip to first unread message

Kem Mante

unread,
Feb 17, 2015, 4:10:08 AM2/17/15
to arduino-pincha...@googlegroups.com
Hello,

I'll try to explain my problem with the library.

In fact, I use this one in order to detect analog interruption with the Arduino LCD KeyPad Shield which has 5 butons with resistances in the A0 of my Arduino UNO.

It's a success with 3 of the 5 buttons (right, up & down) however "select" and "left" buttons are not detected by "PCintPort::attachInterrupt(PinBouton, boutons, FALLING);"

and that's explain why only "select" & "left" aren't recognize but there may be a solution..?




Thanks in advance,

Kemanthe


Michael Schwager

unread,
Feb 17, 2015, 12:25:59 PM2/17/15
to arduino-pincha...@googlegroups.com, kema...@gmail.com
There are no interrupts based on Analog level. The interrupts are based on digital (1/0) signals only. There's no way this library will work with that device, sorry.

(There is an interrupt based on a read by the A/D converter, but that's a completely different thing).

--
You received this message because you are subscribed to the Google Groups "arduino-pinchangeint-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to arduino-pinchangeint...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
-Mike Schwager

Michael Schwager

unread,
Feb 17, 2015, 12:40:04 PM2/17/15
to arduino-pincha...@googlegroups.com, kema...@gmail.com
...BTW, since "Select" and "Left" are the highest on the voltage divider, they never bring the voltage down low enough to make it "FALLING", which is why they are not recognized. The other switches do.

The solution is not to use an interrupt library for this function, but simply poll the switches. That is the disadvantage of the way they've done it: There's no way to interrupt to read the values. However, if your loop is reasonably quick (say, less than 1/4 second), you may not need to worry about it. Just poll; since you're using human-operated pushbuttons you can do a LOT of computing AND have a responsive user interface. 1/4 second is very short to us, very very long to a CPU.


On Tue, Feb 17, 2015 at 3:10 AM, Kem Mante <kema...@gmail.com> wrote:

--
You received this message because you are subscribed to the Google Groups "arduino-pinchangeint-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to arduino-pinchangeint...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
-Mike Schwager
Reply all
Reply to author
Forward
0 new messages