|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Help with joystick
hello! we're a rookie team for the FIRST robotics competition and we're using intelitek's easyC. we got the robot driving, but how do we use the other buttons such as the little joystick on the joystick, the trigger, thumb, and the other two buttons? i've tried relay, but i found it to work only on spikes. How do we get it to work on victors? any help would be greatly appreciated, thank you!
|
|
#2
|
|||
|
|||
|
Re: Help with joystick
You will first have to assign each of the buttons as a digital input. In the browser, expand the RC Control browser. Then drag a Digital OI Input into your program were it can be accessed by the fuction you want it to accomplish. Choose the port that the joystick is plugged into and then choose the button number. 1=Trigger, 2=Thumb, 3=Aux1 (the left button) 4=Aux2 (the right button). As far as I know you can't use the easyC program to use the little joystick. You will need to make a variable for the digital input to retrieve to. Make the varriable an "unsigned char". I'm not sure what you want the buttons to do with the motors but the basic idea is to make so that if xxxxxx (your digital inputs variable) = 1 set pwm to yyyyy (the motors speed). NOTE: the buttons read as 1 if they are pressed, if you release them they go back to 0. Hope this helps.
|
|
#3
|
|||
|
|||
|
Re: Help with joystick
alright!! thanks!! ill try it out tomorrow at school. and does anybody know how to debug on the same line? its the PrintToScreen command but when i try to output 2 variables, its on 2 lines and looks messed up. so does anybody know how to put both on the same line? thanks!
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Change joystick to pwm mapping | Joe Lewis | Programming | 3 | 30-03-2005 19:27 |
| Changing 1 joystick code to 2 (rookie team) | Brawler006 | Programming | 5 | 20-02-2004 17:00 |
| 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 |