My team is constructing an off season robot that is using one of our old control systems. I have everything programmed and working except i'm having troubles with the digital inputs. I need to read pressure sensors, and i cant get the digital inputs to change via the pressure switch or any manual switch. I'm printing the digital input and it is stuck at 1. Is it 1 by default? any suggestions for testing? or am i missing something completely? its been a awhile since i have done anything with the old FRC so maybe i have just forgot something.
The default code contains an example of how to control a compressor on relay8 using the pressure switch on dig_in18, so take a look at that first for an example on reading digital inputs.
–Make sure you have digital_io_18 set to input
–Try a different input, in case the one you’re using is broken
–The inputs have pull-ups enabled, so they’re naturally high by default. The pressure switch should be connected so that it is pulling the input low, i.e. the switch is connected between the signal line and ground.
If you are sure that the switch is working (by using a multimeter) and you are sure your code is correct (by using the default code or code tested by another team), then you should check for metal chips in/around/under the input pins. I’ve seen metal chips create a short that causes all pins to pull high or low, which makes the input “stuck” either on or off.
Tyler,
To be sure, you are using a pressure switch and not a pressure transducer? Both were provided as KOP supplies in some of the past years. The transducer is an analog device, while the pressure switch is a just that and is connected to a digital input. Using a PWM cable, you cut off the connector at one end, pulled back the 5 volt wire and insulated it, then attached the signal and the ground wire of the PWM cable to the switch.