View Single Post
  #1   Spotlight this post!  
Unread 14-03-2014, 10:27
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
Maintenance mode TeleOp

Hey guys! I figured a new idea would be a refreshing change against all the question threads, so I wanna share something that our team realized. Its a cool little trick for keeping shop code and competition code different!

Up until now, whenever we wanted to test something electronically, we would have to create a new project and just instantiate a single motor or sensor or whatever to make absolutely sure nothing else interfered. However, what we realized is that in the main project you use, in the teleOp branch have a simple couple lines of code:
Code:
(operatorControl())
{
	if(DriverStation->GetDigitalIn(8))
	{
		//Competition code, lots of automation, proper button mappings, 
		//etc.,
	}
	else
	{
		//Shop code, simple button assignments, zero automation,
		//rewritten whenever you need to test something, "whiteboard" 
		//code.
	}
}
This way, so long as you make sure you don't use Digital Input 8 for anything else, you can easily test an isolated motor or sensor or whatever, while keeping your same project. Does anyone else use small tricks like this, or improved versions of this?
__________________
"Measure with a micrometer, mark with chalk, cut with an axe."
Reply With Quote