View Single Post
  #3   Spotlight this post!  
Unread 03-02-2016, 16:11
GreyingJay GreyingJay is offline
Robonut
AKA: Mr. Lam
FRC #2706 (Merge Robotics)
Team Role: Mentor
 
Join Date: Mar 2015
Rookie Year: 2015
Location: Ottawa, Canada
Posts: 782
GreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond repute
Re: Toggling Between Two buttons

Quote:
Originally Posted by T3_1565 View Post
That doesn't seem like what he is asking for.

I'm not a programmer at all but I think a variable is the correct way to deal with your request.

if Button A is pressed then set variable "X" to 1.
if Button B is pressed then set variable "X" to 2.
if "X" = 1 then Motor runs one way
if "X" = 2 then motor runs the other way

Again. Not a programmer. Just how your request sounds in my head.
This is correct.

Note that as it stands once one of these two buttons is pressed and the motor turns on, there is no way to turn it off again.