Thread: Switch Program
View Single Post
  #4   Spotlight this post!  
Unread 13-03-2012, 00:42
synthmusic synthmusic is offline
Registered User
FRC #3574
 
Join Date: Feb 2012
Location: Seattle
Posts: 5
synthmusic is an unknown quantity at this point
Re: Switch Program

Quote:
Originally Posted by DavisC View Post
Yes the switch is on the robot connected to DIO port 1 on the DSC.
Not sure if this is what you are looking for, but as an example we have a switch used as a travel limit to stop a motor. It's used as follows:



DigitalInput *bBallElevatorTopLimit;
...
bBallElevatorTopLimit = new DigitalInput(2,2);
...
// if top limit clicked
if (!bBallElevatorTopLimit->Get())
...

the switch reports 1 when it is open and 0 when closed because we wired the switch signal to ground on the DSC.

Hopefully that helps!
Reply With Quote