View Single Post
  #2   Spotlight this post!  
Unread 03-02-2016, 15:20
soundfx's Avatar
soundfx soundfx is offline
Registered User
AKA: Aaron J
FRC #3238 (Cyborg Ferrets)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Anacortes, WA
Posts: 17
soundfx is an unknown quantity at this point
Re: Is my Java code ok?

Quote:
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
MaGiC_PiKaChU is correct. His code will test the absolute value for the threshold, then set the motor power to the joystick. Yours would probably work just as well, but the else if is redundant since it will never evaluate to true.