View Single Post
  #1   Spotlight this post!  
Unread 21-02-2012, 10:46
DavisC DavisC is offline
Registered User
FRC #0539 (Titans)
Team Role: College Student
 
Join Date: Jul 2011
Rookie Year: 2010
Location: Virginia
Posts: 200
DavisC is just really niceDavisC is just really niceDavisC is just really niceDavisC is just really nice
Absolute Value of Joystick position

The joysticks I have are somewhat off center slightly so the drive motors are constantly running at like .05 as an example.

This is what I am trying to do below but I think the Abs() function converts it to an Integer. How can I use it on a float (or should I resort to more "or's" in the "if's"

Code:
if(abs(J_stick1.GetY()) <= .05 || abs(J_stick2.GetY()) <= .05)
     R_myRobot.Drive(0.0, 0.0);
__________________
FRC Team 539
Student Member: 2010 Breakaway - 2014 Aerial Assist
Mentor: 2015 Recycle Rush - present
Reply With Quote