View Single Post
  #4   Spotlight this post!  
Unread 03-29-2016, 10:30 PM
euhlmann's Avatar
euhlmann euhlmann is offline
CTO, Programmer
AKA: Erik Uhlmann
FRC #2877 (LigerBots)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2015
Location: United States
Posts: 298
euhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud of
Re: Button assignment for specific motors

Quote:
Originally Posted by Pault View Post
If you want the arm to move full speed in the positive direction when A on your XBOX controller:

Code:
if(A.get()) {
    arm.set(1);
}
Note that in frc you send motors a value between -1 and 1, with -1 being full reverse, 0 being stopped, and 1 being full forward.
Code:
if(A.get()) {
    arm.set(1);
} else {
    arm.set(0); // !!
}
Motor safety should catch this for you, but please make sure to stop your motors when you're done with them.
Reply With Quote