|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Joystick
I had a question about the abilities of our joysticks. Is there a way to program the buttons or triggers so that when you continuously hold the trigger the action is performed, and when the trigger is released the action stops?
|
|
#2
|
|||||
|
|||||
|
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 |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how do i control a piston with a joystick | Ryan Foley | Programming | 2 | 27-05-2003 17:13 |
| Fried program slots? | Jeff Waegelin | Programming | 18 | 19-03-2003 18:08 |
| robot goes haywire with the one joystick default code | Miles | Programming | 7 | 24-01-2003 14:58 |
| joystick problem | archiver | 2000 | 12 | 23-06-2002 23:08 |
| switching joystick axis????? | team222badbrad | Technical Discussion | 9 | 16-01-2002 23:07 |