View Single Post
  #5   Spotlight this post!  
Unread 14-02-2005, 19:55
AIBob's Avatar
AIBob AIBob is offline
AI Programmer
AKA: Bob Frank DOT org
FRC #0358 (Hauppauge Robotic Eagles)
Team Role: Alumni
 
Join Date: Jan 2005
Rookie Year: 2003
Location: Long Island, NY (in Binghamton now)
Posts: 297
AIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to behold
Send a message via ICQ to AIBob Send a message via AIM to AIBob Send a message via MSN to AIBob Send a message via Yahoo to AIBob
Re: joysticks (new) button layout

Quote:
Originally Posted by stephenthe1
wow, I feel like I'm talking to myself. um, could you tell me if you see any problems with this code (it fires a piston when the trigger is pressed, or if the aux. button is pressed). what code is used to reference the thumb button on the "side" of the joystick? I tried this code and it wouldn't work for some reason. do I need these extra variables? I wasn't sure if the buttons "remember" that they were pressed. but it shouldn't matter anyways. should I place this code in user_routines_fast(), or user_routines()? thanks for all the help. here's the code I'm having trouble with:
You shouldn't need the extra variables.
When pushed the variables are set, when the button is released, the variable is unset.
You do not need to check if it '==1', you can just have it like so:
Code:
//transmission

if (p3_sw_trig)
{
relay1_fwd = 1;
relay1_rev = 0;
}
if (p3_sw_aux2)
{
relay1_fwd = 0;
relay1_rev = 1;
}
__________________
- from B B frank