Capacitive touch for coin slot
I'm trying to use the AT42QT1010 capacitive touch module. The inspiration came from here: https://elecdrome.com/icade-raspberry-pi-mod/
But I can't understand how I should wire the module to the GPIO. I've used the ground and GPIO21 as described in the recalbox wiki for GPIO controller, but probably I still miss something.
A link to the module you're refering to would have been quite appreciated. But I guess you simply need to wire it between and GND and the SELECT pin for P1 or P2. But your controllers need to be wired on GPIO, you can't mix a pad with this
this is the product
too long to read. Let me tell you how the GPIO driver works : it expects the GPIO button pin to be grounded to say "button pushed", and on Hi Z/open to say "button not pressed". I didn't take time to read the full doc to see how your button says "pushed". Can you check by yourself ?
You are absolutely right! Actually it seems non that easy to find info about this item. Anyway this is a description of how it works:
"As long as a touch (e.g. from a finger) is detected, the AT42QT1010 keeps the output line high. Otherwise, the line is kept low. You just need to provide a power source (1.8V - 5V) and ground for the AT42QT1010 to work."
In the project that inspired me, the author says:
"Since the cap-touch sensor (connected to GPIO23) is active-high, the code needed to interpret it differently since all the other GPIO inputs are active-low. Otherwise, the coin-drop will constantly retrigger. Replace line 226 with the following code:
if (io[i].pin == 23)
pinConfig(io[i].pin, "active_low", "1");
pinConfig(io[i].pin, "active_low", "0"); // Don't invert"
Of course it refers to Adafruit retrogame.c but I hope that makes sense for you anyhow.
Ok, but the GPIO drivers expect the pin to be grounded, not at Vcc. So you'd need some more electronics