Photoswitches flashes true but then stays false

Ok, so we were testing out the photoswitches.
The wiring is this:
Brown the positive
Blue to negative
Both on the power distributor with a 20 amp circut breaker
White to port 1 in the digital I/O of the digital sidecar
Basically what happens is that we hit enable, the value flashes true (we have the value printed to the DriverStationLCD) and then stays false.
Here is my code so far

DigitalInput tracker = new DigitalInput(1);
teleopPeriodic(){
DriverStationLCD.getInstance().println(Main6, 1, ""+tracker.get());
DriverStationLCD.getInstance().updateLCD();
}

After some further testing, it seems that the tracker gives some better feedback when we initialize a motor and set it to full force

DigitalInput tracker = new DigitalInput(1);
Victor motor = new Victor(1);
teleopPeriodic(){
motor.set(1);
DriverStationLCD.getInstance().println(Main6, 1, ""+tracker.get());
DriverStationLCD.getInstance().updateLCD();
}

However, it continously flashes true and false when it is detecting something
I’ve tried toying with the sensitivity, but to no avail

Ok, so I finally got a weird solution to the problem
Turns out that for every digital input we initialized (the trackers), we had to create a victor in the corresponding port. Meaning

DigitalInput tracker = new DigitalInput(1);
Victor motor= new Victor(1);

For some reason, initializing this victor makes the photoswitches works correctly

Does your digital sidecar have good power? Are all three LEDs on the digital sidecar brightly lit? Do they stay lit if you remove the DB-37 cable?

If the digital sidecar power isn’t connected, there is still current provided through the DB37 cable, which might be enough for intermittent operation. Add calls to a speed controller will cause more signals to go through the DB37 cable, and provide more power.

All three LEDs are on and shining brightly
When I remove the DB37 cable, the 5V goes off
Am I missing something?
I have two wires coming from the PD with a 20 amp circut breaker going into the dsc J22
and I got the db37 cable coming from the cRIO

The fact that the 5V LED goes off when you remove the DB37 cable indicates that there is a problem with the power wiring of your digital sidecar. It’s sometimes possible to crimp the insulation of the wire in the wago connector, rather then the bare wire. Verify that you actually have 12 volts at the digital sidecar connector.