Go to Post Any metric you want to apply to Pink, they will pass with flying colors. Pun intended. - Lil' Lavery [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Spotlight this post!  
Unread 21-02-2014, 10:17
Sparkyshires Sparkyshires is offline
Registered User
AKA: Michael Shires
FRC #0384 (Sparky)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2006
Location: Virginia
Posts: 226
Sparkyshires is an unknown quantity at this point
Re: BCD switch programming

Have you looked at the digital inputs on the driver station? Our team uses those exclusively for deciding which autonomous we're going to use. Last year we had 7 different autonomi xD And we use a big 'if' statement, with the arguments looking something like this:
Code:
if(ds->GetDigitalIn(1))
{
	//Autonomous1
}
else if(ds->GetDigitalIn(1))
{
	//Autonomous2
}
etc.. This is a simple way to do it. You could also use a switch-case statement, would definitely be one of the few uses in robot programming to use it. The only reason we don't is just that switch-case statements are so rarely useful in FRC programming that we normally forget about them you would have to pass your switch case variable as an argument in the GetDigitalIn function.
__________________
"Measure with a micrometer, mark with chalk, cut with an axe."
 


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 22:03.

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