View Single Post
  #10   Spotlight this post!  
Unread 07-02-2007, 19:22
Tureyhall Tureyhall is offline
Registered User
AKA: Thomas Hall
FRC #0668 (Apes Of Wrath)
Team Role: Programmer
 
Join Date: Feb 2006
Rookie Year: 2004
Location: San Jose
Posts: 40
Tureyhall will become famous soon enoughTureyhall will become famous soon enough
Re: button programming

Quote:
Originally Posted by joesmomh00haha View Post
:Also: to add more inputs we tried using "wheel" but it keeps going until we press the "wheel" then it will go the right direction until we let go.

wheel is analog. You'll have to do something like:
#define p1_sw_wheel ((p1_wheel > 127) ? 1 : 0)

This means that if p1_wheel is greater that 127 (which I'm assuming is when the button is pressed. If not, change it to < ) it'll evaluate to 1, and if it's less than 127 (which I'm assuming is not pressed) it'll evaluate to 0.
__________________
/*Nerd Camouflage*/

2005 SVR - 668+1072+840 - Semifinalists.
2006 SVR - 668+1280+1693 - Finalists.
2007 SVR - 668+604+624 - Quarter-finalists, Xerox Creativity Award, two highest scores (290-2, 128-0) at SVR.
2007 Nat's - TBA.