View Single Post
  #5   Spotlight this post!  
Unread 03-02-2016, 14:54
Lesafian Lesafian is offline
Registered User
AKA: Jeremy Styma
FRC #6077 (Wiking Kujon)
Team Role: Programmer
 
Join Date: Feb 2016
Rookie Year: 2016
Location: Posen, Michigan
Posts: 22
Lesafian is an unknown quantity at this point
Re: Is my Java code ok?

Won't this only work if I move the stick up? Shouldn't I need both > and < .1 if I'd like to both increase and decrease

Example of what I mean:
Code:
			if (Math.abs(xboxController.getRawAxis(5)) > .1) {
                               
                                //set your motor output to the axis value
				slideMotor.set(xboxController.getRawAxis(5));

			
			}else if (Math.abs(xboxController.getRawAxis(5)) < .1 {
                                slideMotor.set(xboxController.getRawAxis(5));
                        }