|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Switch Program
Using the Honeywell Switch on the robot. What declaration do I use? And how do I get the state it is in? Do I use the DigitalIOButton to declare it and just use the Get() which returns a bool value?
Thanks in advance! Davis |
|
#2
|
||||
|
||||
|
Re: Switch Program
The DigitalIOButton class is for a button on the DriverStation (e.g. connected to the Cypress module). Are you using that? Or is your switch connected to the robot? I am assuming it's on the robot. If so, are you connected it through some digital input channel? The way to access a switch connected to a digital input channel is something like this (assuming digital input channel 1):
Code:
DigitalInput limitSwitch(1); ... ... limitSwitch.Get(); Last edited by mikets : 29-02-2012 at 13:26. |
|
#3
|
|||
|
|||
|
Re: Switch Program
Yes the switch is on the robot connected to DIO port 1 on the DSC.
|
|
#4
|
|||
|
|||
|
Re: Switch Program
Quote:
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! |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|