![]() |
Joysticks question???
Hi guys
I have a question regarding the joysticks can you program the buttons on the joysticks to functions? thanks |
Re: Joysticks question???
I'm pretty certain you can. I am almost certain that I have seen other teams do this in the past. But honestly, I am not certain. I advice you to wait for someone else to respond, but I am almost certain.
|
Re: Joysticks question???
I'm not certain what you are asking, but I'll give it a shot. I think you are essentially saying "Can I use the joystick buttons in my code?," if so, the answer is yes.
|
Re: Joysticks question???
thank you, i understand that. But i was wondering how you program it to do something???
|
Re: Joysticks question???
Code:
if (p1_sw_trig) |
Re: Joysticks question???
Quote:
if (trigger_switch == 1) motor_output = 255; else motor_output = 127; I think that's right... but it's saying if you press a button that has been declared "trigger_switch" the motor that motor_output is associated with will run full bore one direction, and if let up on the trigger, it will stop. Malhon |
Re: Joysticks question???
so the joysticks buttons can be programmed using the "if" option on easy c??
|
Re: Joysticks question???
Yes, your first step is to use the OI Digital input block to get the reading off the joystick. Then you can assign the button to an unsigned char variable, and then use the if statement to "test" the variable. Now, if you decide to use the thumbstick on the joystick, that is a little different, as that thumbstick is actually a four or eight (I can't remember) position analog input. for ex. If you point the stick up, you might get a reading of 90, but if you point it left, you might get a 500 or something. In that case, you will use the OI analog input, but same basic principle.
|
Re: Joysticks question???
can i hook up the limit switches with the joystick??
is there anyway that this is possiblE |
Re: Joysticks question???
another question
how am i suppose to connect the limit switch to the relay outputs???? what kind of wire do i need??? be specific please! |
Re: Joysticks question???
You don't hook the limit switches up to the joystick, although you can, limit switches are generally ment to be hooked up to the digital input section of the robot controller via pwm style cable. You can use this the same way as the joystick. If you want to hook up a switch to the joystick, you need to do some custom wiring and hook the switch up to the appropriate pins on a DB 15 game controller plug. Here's a link with pinouts and how joysticks work: http://www.epanorama.net/documents/j..._joystick.html
Good Luck Malhon |
| All times are GMT -5. The time now is 14:59. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi