Go to Post Don't waste the opportunity because you were too focused on "winning" the championship. - Don Wright [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 29-02-2012, 13:08
DavisC DavisC is offline
Registered User
FRC #0539 (Titans)
Team Role: College Student
 
Join Date: Jul 2011
Rookie Year: 2010
Location: Virginia
Posts: 200
DavisC is just really niceDavisC is just really niceDavisC is just really niceDavisC is just really nice
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
__________________
FRC Team 539
Student Member: 2010 Breakaway - 2014 Aerial Assist
Mentor: 2015 Recycle Rush - present
Reply With Quote
  #2   Spotlight this post!  
Unread 29-02-2012, 13:22
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 671
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
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.
Reply With Quote
  #3   Spotlight this post!  
Unread 29-02-2012, 13:23
DavisC DavisC is offline
Registered User
FRC #0539 (Titans)
Team Role: College Student
 
Join Date: Jul 2011
Rookie Year: 2010
Location: Virginia
Posts: 200
DavisC is just really niceDavisC is just really niceDavisC is just really niceDavisC is just really nice
Re: Switch Program

Yes the switch is on the robot connected to DIO port 1 on the DSC.
__________________
FRC Team 539
Student Member: 2010 Breakaway - 2014 Aerial Assist
Mentor: 2015 Recycle Rush - present
Reply With Quote
  #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
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 03:00.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi