Romi - Digital I/O Issues

Hey everyone - I’m hoping someone can shed some light into issues I’m seeing with our Romis. We’re using our offseason to train up some recruits and the Romi has been a helpful tool in getting them oriented with the basics of the WPI framework, working with the drivetrain, and other small things.

Today I was hoping to show them how to read a digital input and how to run commands based off that. I’ve spent most of the morning attempting to get this to work and sadly haven’t had much success. Here’s a quick rundown of my setup.

In the web UI I’ve gone through and setup all of my external IO to digital inputs.

I’m using a basic timed robot to keep things simple. In robotInit I’m going through and creating all of my inputs…

public class Robot extends TimedRobot
{
    private final List<DigitalInput> inputs = new LinkedList<>();
    private int count = 0;
.....

    @Override
    public void robotInit()
    {
        inputs.addAll(Stream.of(0, 1, 2, 8, 9, 10, 11, 12).map(DigitalInput::new).toList());
    }

Then in teleopPeriodic I’m simply looping through the inputs and printing out the results…

@Override
    public void teleopPeriodic() {
        if(count++ % 100 == 0) {
            inputs.forEach(i -> System.out.println(i.getChannel() + ": " + i.get()));
        }
    }

Sadly despite all of my attempts I cannot seem to get them to change state. This includes the onboard buttons (0-2) and the external inputs (8-12).

In the simulation dashboard I can change their default state from low to high, and in that case I do see things switch from false to true. But that doesn’t seem to change this behavior.

To add insult to injury, whenever I short the external pins (either through a limit switch or with a paper clip / screwdriver / probe) the Romi beeps at me, seeming to acknowledge that it knows it’s been clicked. I’m starting to think it’s taunting me :smile:

Does anyone have experience with the Romi that could potentially point me in a direction for how to get these guys to switch states? Any help would be appreciated.

EDIT: Also worth noting, I’ve ensured the firmware and web ui are current.

Couple of things to check:

  • is it just the inputs that are not working (i.e. driving, servos, digital output to the LED all work?)
  • fresh batteries?
  • with the firmware and wpilibpi image reflashed to defaults (i.e. having the EXT pins set to their default functionality), does reading digital input work?

I’ll dig up a Romi in a bit to see if I can spot anything else

Thanks for replying! I think I figured it out. Seems the jumper needs to go between ground and signal pin row, not the 5v row. Or maybe it can just be removed. But once I did that everything works great.

Im wondering if the image in the web ui is trying to say ‘remove the jumper’, not ‘put it here’. I think that was my main source of confusion.

Ah so the jumper is there to provide power to that middle row (which for servos, is the 5V line). In Digital In mode, the pins are set to use a pull up resistor, so you should be able to connect signal → ground to get a response

Makes sense in hindsight. And the beeping was me shorting the robot. Live and learn.

I doubt you’re releasing any updates anymore, but if you did, adding some clarification in that section of the UI to what that image actually means would be helpful.

Thanks again for your help.