View Single Post
  #1   Spotlight this post!  
Unread 02-23-2016, 11:55 AM
King Nerd III's Avatar
King Nerd III King Nerd III is offline
Chief Programmer/Head of Autonomous
AKA: Isaac
FRC #1410 (The Kraken)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Denver, CO
Posts: 113
King Nerd III is an unknown quantity at this point
Commands Ending Other Commands

I have a commands that runs the rollers outwards and a command that runs the rollers inwards, but if one is running and you call the other one (through pressing a button), then both commands attempt to run at the same time. Is there any way to have each command end the other one when called?
I had an idea where you declare a Command object in the command of the other command (i.e. Inwards has an Outwards Command object in it) and when one is initialized it calls End() from the object, but I don't know if that would work, and don't have the robot electronics board with me to test right now. Any ideas?
__________________
Isaac
Chief of Programming and Head of Autonomous Control
FRC Team 1410
Reply With Quote