View Single Post
  #2   Spotlight this post!  
Unread 26-11-2011, 23:54
PhilBot's Avatar
PhilBot PhilBot is offline
Get a life? This IS my life!
AKA: Phil Malone
FRC #1629 (GaCo: The Garrett Coalition)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Maryland
Posts: 747
PhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond repute
Re: [FTC]: RobotC returns junk joystick data?

Does it only happen when the joystick is fully forward (not backwards)?

If so, it sound like a signed to unsinged integer conversion problem.

Since the joystick actually puts out max negative when you push it forward, somewhere in the software is negating the number. Since there is a -128 in 8 bit signed math, but not a +128, this is sometimes converted incorrectly.

If that's what it is, you might also expect it to happen to the X axis when you move the joystick all the way to the left, but it may not since that value probably isn't reversed.

I don't use Robot C. What "type" is the joystick value (byte or integer)?

Phil.
__________________
Phil Malone
Garrett Engineering And Robotics Society (GEARS) founder.
http://www.GEARSinc.org

FRC1629 Mentor, FTC2818 Coach, FTC4240 Mentor, FLL NeXTGEN Mentor
Reply With Quote