View Single Post
  #14   Spotlight this post!  
Unread 22-01-2015, 15:51
team-4480's Avatar
team-4480 team-4480 is offline
Debug? What's that?
FRC #4480
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Minnesooota
Posts: 229
team-4480 will become famous soon enoughteam-4480 will become famous soon enough
Re: Python: button no attribute to wpilib ?

Quote:
Originally Posted by virtuald View Post
Also, looking further, your controller adjustment code is wrong. The values returned from the joystick are in the range [-1, 1], so you don't need to divide by 255.

Additionally, you shouldn't have the 'else: pass' at the end of your statement. If you ever hit that condition, then x1 won't be set, and your code will die with an exception. It should be 'else: x1=??', where ?? is the default value (probably 0?).

Looking around CD, you'll see that most people adjust the joystick curve by squaring the inputs instead of a sequence of if statements as you have there.
Thanks with your help, we got our buttons to work! When I am using cmath for square root of the getX and getY, I get a...
Code:
TypeError: unorderable types: complex() > float()
Again, I can not thank you enough for your help!