#2001 Converting from touch to real buttons?

hi, im kinda new here but is it possible to put a physical button instead using capacitive touch pads(cause i have a lot of arcade buttons) without changing the code?

If you show us a schematic of the device, it will be much easier to reply to your question. However, not having one, in general if a capacitive touch buttons electronically speaking acts as a push button outputting a 1 or a zero, then you should be able to replace them with arcade buttons and a pull down or pull up resistor. However if the capacitive switch outputs an AC voltage, then this becomes more complicated.

1 Like

The schematic is here as is the code:

Looking at both I’m not even sure the “capacitive touch” description is correct. I’ve never worked with capacitive touch but my understanding is the way it works is the microcontroller measures the time it takes to reach full charge on its input, and when the capacitance changes (due to touching the pad) that charge time changes. But (from a very brief look) I don’t think the code here is doing that. It’s just looking to see if the analog input is above threshold; it’s not doing any timing — so capacitance seems to have nothing to do with it. The input pins have pullup resistors so will read high normally. But I don’t know why it would read lower when you touch a pad. Maybe when you’re touching a pad you’re large enough to serve as “earth”, pulling the input voltage down?

However it works, it does seem what the code is looking for is just whether the input is high or low, and if the pad were replaced by a normally open push button connecting to ground that would give a high input when the button is not pressed and low when it is. So my guess is that would work.

I wouldn’t just go ahead and build it that way, though, I’d do some breadboard testing.

1 Like

It’s using arduino-I’m on tablet so I can’t read the .ino but chances are it’s using the touch library, so it’s pretty likely you’ll need to change the code. At least it will be going from complex to simple.

It does not use the touch library.

thank you for the replys i will test it on my breadboard

1 Like