Go to Post Now, what we really need is a big spotlight in the sky that shoots out the letters "CD" so Brandon knows to come running to the server cave ... - mtrawls [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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!
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 22:08.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi