|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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 Code:
DigitalInput tracker = new DigitalInput(1);
teleopPeriodic(){
DriverStationLCD.getInstance().println(Main6, 1, ""+tracker.get());
DriverStationLCD.getInstance().updateLCD();
}
|
|
#2
|
|||
|
|||
|
Re: Photoswitches flashes true but then stays false
After some further testing, it seems that the tracker gives some better feedback when we initialize a motor and set it to full force
Code:
DigitalInput tracker = new DigitalInput(1);
Victor motor = new Victor(1);
teleopPeriodic(){
motor.set(1);
DriverStationLCD.getInstance().println(Main6, 1, ""+tracker.get());
DriverStationLCD.getInstance().updateLCD();
}
I've tried toying with the sensitivity, but to no avail |
|
#3
|
|||
|
|||
|
Re: Photoswitches flashes true but then stays false
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 Code:
DigitalInput tracker = new DigitalInput(1); Victor motor= new Victor(1); |
|
#4
|
||||||
|
||||||
|
Re: Photoswitches flashes true but then stays false
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. Last edited by Joe Ross : 02-02-2011 at 09:30. |
|
#5
|
|||
|
|||
|
Re: Photoswitches flashes true but then stays false
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 Last edited by kinganu123 : 03-02-2011 at 14:55. |
|
#6
|
||||||
|
||||||
|
Re: Photoswitches flashes true but then stays false
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.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|