Timeline for GPIO.add_event_detect fires callback multiple times and on wrong signal edge
Current License: CC BY-SA 3.0
13 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 22, 2014 at 10:21 | history | tweeted | twitter.com/#!/StackRaspi/status/469422804027588608 | ||
Mar 22, 2014 at 17:53 | answer | added | Fred | timeline score: 1 | |
Mar 22, 2014 at 15:23 | comment | added | Gerben | If GPIO 22 is the only one, try using some other GPIO. If it's bounce, you might want to try adding some small capacitors to the inputs. You could also try to have the code trigger rise and fall, and store the current state of the pin in a variable. If the state hasn't changed immediately exit the function (return). | |
Mar 22, 2014 at 1:55 | comment | added | Adam Haile | Ahhh... makes sense. Not sure what I can do about the wiring, it's pretty simple and most of it is in the keypad itself. I wish I could simply ignore any new callback directly after the initial one but it doesn't ALWAYS happen, so it's tough to check for. | |
Mar 22, 2014 at 1:52 | comment | added | Milliways |
The problem you are having is almost certainly contact bounce. While you have GPIO.add_event_detect(self.COLUMN[c], GPIO.FALLING, bouncetime=500, callback=self.__colRise) this will only operate on the bounce following press, but not when the key is released. You also need to make sure that the wiring layout minimises interference, as the Pi GPIO is very sensitive to stray signals.
|
|
Mar 21, 2014 at 16:16 | comment | added | Adam Haile | sadly, I've tried it with both already | |
Mar 21, 2014 at 16:16 | comment | added | ExploWare | ok, I don't know much about the internal resistors and how they influence the 3.3v, and if you maybe would be better off make it a pull-down, instead of pullup circuit. But I'm sure someone else has some better knowledge of this part. | |
Mar 21, 2014 at 16:07 | comment | added | Adam Haile | It's a standard 4x3 matrix keypad hooked directly into the GPIO pins as described in the code. The only resistors in use are the built in pull up/down resistors on the chip, also as described in the code. Not really much else to show. | |
Mar 21, 2014 at 16:06 | comment | added | ExploWare | depends on your resistor-usage, can you show us your hardware? | |
Mar 21, 2014 at 16:04 | comment | added | Adam Haile | Kinda thought the voltage was fixed at 0V or 3.3V? | |
Mar 21, 2014 at 15:52 | comment | added | ExploWare | I have noticed my hardware sortof works like an antenna also. I dont know what your hardware looks like, but raising the high voltage or lowering the low may be worth trying. | |
Mar 21, 2014 at 14:12 | history | edited | Adam Haile | CC BY-SA 3.0 |
edited body
|
Mar 21, 2014 at 13:36 | history | asked | Adam Haile | CC BY-SA 3.0 |