How does DriverStation.getInstance().getDigitalInput(1) work?

Hi.

I am confused with this method. For the lane tracking, why we need to receive digital values from driver station? How does this work? I am testing our sensors with the example code that provided by the templates. I can receive the changing values with DigitalInput.get(), but the output for those three sensors with DriverStation.getInstance().getDigitalInput() are all true without changing.

I am really confused. I need your help. Thank you!

The sensors might be a reverse bool, where if they’re false it strikes up a nice ol’ conversation with your motors (if you programmed them that way.)

That’s just a complete guess, though. Haven’t tried looking through the code at all. ::rtm::

The getDigitalInput() method in the example code is for user input, using the actual software driver station buttons to switch between forked and straight, and to take the left or right fork. They have nothing to do with the actual photoreceptors, and won’t be changed by their state.

If you go to the I/O tab on your Driver Station, you will see the buttons.