View Single Post
  #4   Spotlight this post!  
Unread 22-05-2016, 07:59
michaelyork michaelyork is offline
Registered User
FRC #3680 (Elemental Dragons)
Team Role: Programmer
 
Join Date: Mar 2014
Rookie Year: 2014
Location: Statesville, NC, United States
Posts: 18
michaelyork is an unknown quantity at this point
Re: Code Review: Semi-Novice

Quote:
Originally Posted by mikets View Post
We don't do command based programming and also not knowing what each subsystem is supposed to do, I just looked through the code and found a couple of minor optimizations on boolean expressions.
Code:
    	...
    	if(button10left.get() && !button10LeftLast) { 
    		button10LeftLast = true;
    		compDisable = !compDisable;
    	}
    	...
    	Intake.isFinished()
    	{
   		return !RobotMap.intakeOutSwitch.get();
    	}
Thank you! I'll get those fixed up ASAP.

Quote:
Originally Posted by Lireal View Post
The major issue I see with your code is that you are using the sybsystems and RobotMap completely wrong. Your RobotMap should only include really include numbers. All of your motor controllers, sensors, etc. should be a in your subsystems. Read through these examples and you will see how to do it: https://wpilib.screenstepslive.com/s.../13809/c/88893
Oh gosh, I didn't know I was doing it wrong this whole time. I'll definitely beg our team to get a new control system so I'll be able to practice with doing it the right way. Thanks!

If anyone else sees something wrong with my code, please let me know. I'm making a bit of a list of stuff I need to practice.
__________________

FRC Team 3680 - Head Programmer (2014-), President (2016-)
2014 - North Carolina Regional Creativity Award
2016 - North Carolina District Qualification (UNC Asheville Event) Winner, Judge's Award
Reply With Quote