Can you Y cable touch sensors?

Can you Y cable two touch sensors together?
If so, would they output like an and or an or operator?
I can’t see them acting like any others.

I’m wondering because I only have 1 digital port left.

It would be an or statement. Either button being down would be 0.

I’m pretty sure it’s a 1, actually.

@Bryon Tjanaka Can confirm – it is a 0. I don’t agree with it and it SHOULD be a 1, but it’s a 0. It acts this way on both bumper and limit switches. Although why is the true question now…

this is because the digital ports configured as an input float to a high state
similar to this diagram

when vex switches (and jumpers) are pushed they connect ground and digital together so it reads 0, when not pushed down the line is left in a floating state so it reads 1

it is designed like this in most electronics for a few reasons, it reduces the chance of something going wrong where the digital line is grounded and the button short circuits the 5v line

I’ve been there, done that. Most recently with a middle school team with two buttons on their front bumper to detect the low goal.

Design: One button at center
Fail: If you hit at an angle the button does not get pushed
Design Iteration: Put two buttons on either end of the bumper
– No code needed, extra bumper switch and a Y cable

Boy, do I love electronics

Ah, should have thought of that – I suppose that was my inner programmer.

I have wired two bumper switches using a Y-cable before, and what basically happens is that, to the Cortex, the individual switches are all one giant switch, so that if any of them are pressed, it’s like all of them are pressed. In other words, like others have said above, it’d be an OR statement.

Also - correct me if I’m wrong, but can’t you repurpose an analog port to serve as a digital port? Just configure it as analog in, and then 255 would be High and 0 would be Low? Then, you could still get individual functionality instead of “joining them together”.

I’ve never actually done this so I might be wrong, but I remember reading about teams that had.

yes most people do that when they want to use analog ports and jumpers for auto selection, i would be on the safe side and have port < 16 be high