![]() |
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 |
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); |
Re: Switch Program
Yes the switch is on the robot connected to DIO port 1 on the DSC.
|
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! |
| All times are GMT -5. The time now is 17:34. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi