DIO not working on roboRio

Hi,
I’m having problems getting values from the DIO ports. When I use the DigitalInput.get() method (in Java) it always returns false, even when we shortcut the port

Anyone else had this problem?

Thanks!

Can you post your code? It will be easier to debug that way.

Also, to clarify: by “shortcut the port”, do you mean to jumper the ground line to the signal line (the two outer pins) to each other, leaving the supply line (center pin) disconnected?

If so, we were having a problem with touch sensors on our lift face that may have had this issue. We had assumed that this was a problem in our code, but we back-burnered the problem because the touch sensors were getting beaten up too badly anyway as our driver practice picked up speed and moved on to things we are more likely to get working by Wednesday evening. I believe that programming will have use of the practice 'bot on Tuesday; I’ll see if we can work in a simple test to see if it’s perhaps a hardware issue.

we print the result of myDigital.get(); in the riolog

myDigital has been initialized as a Digital input in robotMap.java, and we tried with every port

GeeTwo:
I don’t think our switches are getting beaten up… we tried to press them manually, and we tested the with a multimeter to confirm that they work. The result is false, whatever pins are connected to each other in the port.

1 Like

I didn’t think that was the problem with your switches; I was just explaining why we moved on rather than solve ours.

The test we came up with to verify electrical connection and switch function:

  • Put the robot on blocks.
  • Get a short pwm extension cable (black/red/white wires, dupont connectors, one end male, the other female).
  • Use it to extend your sensor cable at the 'RIO end. Be sure that black is to ground, and white is to the signal.
  • with the robot powered on and the switch open, measure the voltage from black to white, using the little ratchet ports in the side of the dupont housing. It should be a bit over 3V.
  • Push the switch closed. The voltage drop across the same junction should switch to 0V.

If you get those results, the problem is either with the 'RIO hardware or the software, or that the switch isn’t being mechanically activated.

The DIOs are sinking inputs. They should read high (True?) when open or not conncected. False when connected to 0 V. Connecting them to +3.3V or +5v reads the same as open.

Does the value change to true in Test mode?

Thanks GeeTwo we tried again and it seems to be working for some reason :ahh:

The whole system, or just the electrical end?

If it’s the whole system, it must be a Heisenberg effect - measuring the system causes it to change state ;->.