View Single Post
  #2   Spotlight this post!  
Unread 24-03-2016, 22:12
JohnFogarty's Avatar
JohnFogarty JohnFogarty is offline
Trapped under a pile of MECANUMS :P
AKA: @doctorfogarty
FTC #11444 (Garnet Squadron) & FRC#1102 (M'Aiken Magic)
Team Role: Mentor
 
Join Date: Aug 2009
Rookie Year: 2006
Location: SC
Posts: 1,577
JohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond repute
Re: Need Help With Encoders

First off you need to read the documentation on Switches in Java and then take a look at your code.

https://docs.oracle.com/javase/tutor...ts/switch.html

Now, on to the first code segment where I see issues.

Code:
public void autonomousPeriodic() {

switch (autoSelected) {

case "doNothing":
break;

default:

case defaultAuto:
LowBarAuton();
//encoderAuto();
break;

// case "spybot":
// SpyBotAuton();
// break;
// case "rampWithStuff":
// RampAuton();
// break;

}
}
Your default case needs to be at the end of the switch statement I believe, and you need a "break;" after the "default:".

You do that correctly in your LowBarAuton() method. Your programmer has assumed that the case "defaultAuto" was set to the default case and I do not believe it has been.
__________________
John Fogarty
2010 FTC World Championship Winner & 2013-2014 FRC Orlando Regional Winner
Mentor FRC Team 1102 M'Aiken Magic
"Head Bot Coach" FTC Team 11444 Garnet Squadron
Former Student & Mentor FLL 1102, FTC 1102 & FTC 3864, FRC 1772, FRC 5632
2013 FTC World Championship Guest Speaker
Reply With Quote