|
Re: button activation for motor
It sound like a simple "State Machine" will do the trick.
Default it so that a "0" value is sent to both Victors. Then when button 1 is pressed, a 1 is sent to one victor and a -1 is sent to the other. Have this second state look for button 2 to be pressed. If 2 is not pressed, it stays in this state. Once button 2 is pressed, it switches state back to the first, default, state.
The last bit of logic you might want to apply is to prevent the pressing of both buttons 1 and 2 at the same time from causing a problem. To do this, place an AND gate in line with button 1, then put an inverter between button 2 and the second input on the AND gate. The output of the AND gate will go into the state machine as the button 1 input.
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
|