View Single Post
  #2   Spotlight this post!  
Unread 03-02-2009, 19:44
Maxpower57's Avatar
Maxpower57 Maxpower57 is offline
Fabuloso
AKA: Maxwell V.
FRC #2574 (RoboHuskie)
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2008
Location: St. Anthony, MN
Posts: 53
Maxpower57 will become famous soon enoughMaxpower57 will become famous soon enough
Send a message via AIM to Maxpower57
Re: Trouble Reading Drivers Station Digital Inputs

Quote:
Originally Posted by Mike Mahar View Post
I'm finding that reading the drivers station digital inputs is unreliable. Our switch panel isn't ready yet so I am tying the signal pin of port 8 directly to the +5 pin. This should avoid the lack of a pull up or pull down problem on the digital inputs.

I'm using the iterativeRobot class. When I call the drivers station method
Code:
value = m_ds->GetDigitalIn(8);
I usually get a one value returned but sometimes I get a zero.

I notice that IterativeRobot class is synchronized to the drivers station packet. But the DriversStation access methods all do a GetData() call. It looks like GetData does a wait for a new packet although the comment says that it doesn't.

Has anyone seen this?
we had this problem too. the problem is that the driverStation reads the switch as a 1 if the signal has a + voltage and a 0 otherwise. which sounds nice except if it is disconnected, it bounces back and forth between 1 and 0 (blame cosmic rays)

the fix is (sort of) easy, though a little unprofessional
attach a ground wire with a 150ohm-ish resistor(thats what we used) to the signal pin, and have the switch connect the positive pin as normal
this wil cause the voltage to always be negative if the switch is disconnected, and when it is connected, mostly positive

you might want to play around with the resistor ohms to get a good mix


hope that helped
__________________

Last edited by Maxpower57 : 03-02-2009 at 19:47.
Reply With Quote