Thread: Joystick
View Single Post
  #2   Spotlight this post!  
Unread 15-01-2003, 10:48
D.Viddy's Avatar
D.Viddy D.Viddy is offline
Registered User
AKA: Dylan Vester
FRC #3176 (Purple Precision)
Team Role: Programmer
 
Join Date: Jan 2003
Rookie Year: 2001
Location: Camby, IN
Posts: 44
D.Viddy is an unknown quantity at this point
Of course

It's going to look something like this (note: I use the underscores for indention purposes only, do not include them in your code):

'If port1 trigger is pressed then
If p1_sw_trig = 1 then
_____'Perform Action Here
endif

Or if you wanted it so when you pressed a joy button it would turn an action on, and when you pressed it again, it would do another action then:

'Declare this variable at top of code
action_on VAR byte

'If port1 trigger is pressed then
If p1_sw_trig = 1 then
_____'Switch from on to off
_____toggle action_on
endif

'If alternate action is specified then
If action_on = 1 then
____'Do action here
else
____'Do another action here
end if
__________________
.................................................. .........
Dylan Vester - (Programmer)
Running a P4 1.8 Ghz
Team 998, We can't win...
.................................................. .........