Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   button programming (http://www.chiefdelphi.com/forums/showthread.php?t=53217)

joesmomh00haha 01-02-2007 15:10

button programming
 
How do you program the buttons on the 360 controller?:eek:

Alexa Stott 01-02-2007 15:17

Re: button programming
 
It should all be in the user manual.

joesmomh00haha 01-02-2007 15:30

Re: button programming
 
we have read it several times and we need to know how to program the controller to use the triggers, rb, lb,a,b,x,y,and the right joystick. We need them to operate some motors through the relay outputs. Our programmers are new to this and we can use the help.:confused:

Andrew Morris 01-02-2007 15:38

Re: button programming
 
On page 5 of the manual there are tables showing the type of input to the controller you will get in the different modes(eg. trig, top, aux1, wheel). These combined with whatever port you have the controller plugged into give you the names to use for reading them(eg. p1_sw_trig, p1_sw_aux1). Then you can use those to control the relay ports on the RC.

If you want to use all the buttons and the right stick but not the left stick you should use mode 4 on the USB chicklet

Hieb 01-02-2007 15:48

Re: button programming
 
First you'll need to figure out which ports the buttons map to. I don't have time for much detail, but I'd probably just write in a quick debug routine with printfs to show in the terminal window which button was being pushed (ex. p1_trig, p1_aux1, etc).

joesmomh00haha 01-02-2007 15:53

Re: button programming
 
the mode is good, we are using mode 3 using the left joystick to control the whole robot(which is what we want). the problem we are having is how to program the xbox360 controller to use motors in the robot(our arm consists of at least 8 different motors for different parts of the arm, and we want to know how we would program the controller to use those motors, we already have 4 buttons programmed(a and b are relay 1, x and y are relay 5) to move or turn on the motors but we don't know how to program the rest of the other robots.):confused:

AdamHeard 01-02-2007 16:35

Re: button programming
 
8 different motors for the arm?

You're probably going to need some feedback on there to make that work.


For the Controller, the chiclet manual tells you what it outputs as. Then in your code you have to change a motor based on that.

The simplist version is proportional drive; but that would be rather inneffective for an arm.

This is an example of the motor from port one being powered by a joystick.
Quote:

pwm01 = p1_x;

joesmomh00haha 02-02-2007 08:02

Re: button programming
 
we need to program the buttons to control the motors. we are ok with the joysticks. the motors need to program through the relay outputs.:confused:

joesmomh00haha 07-02-2007 08:20

Re: button programming
 
to those who told us to read the manual.
Thank you very much, we have not thought of that.
It is not that we need 8 motors.
we only need 4 but they have to go both ways.


:Also: to add more inputs we tried using "wheel" but it keeps going until we press the "wheel" then it will go the right direction until we let go.:confused:

Tureyhall 07-02-2007 19:22

Re: button programming
 
Quote:

Originally Posted by joesmomh00haha (Post 573503)
:Also: to add more inputs we tried using "wheel" but it keeps going until we press the "wheel" then it will go the right direction until we let go.:confused:


wheel is analog. You'll have to do something like:
#define p1_sw_wheel ((p1_wheel > 127) ? 1 : 0)

This means that if p1_wheel is greater that 127 (which I'm assuming is when the button is pressed. If not, change it to < ) it'll evaluate to 1, and if it's less than 127 (which I'm assuming is not pressed) it'll evaluate to 0.

joesmomh00haha 08-02-2007 08:24

Re: button programming
 
good lookin out. that code is workin so thanks alot.:D

joesmomh00haha 09-02-2007 08:21

Re: button programming
 
new obstacle..
is there a way to make the wheel go as a sw on both the x and y:confused:

joesmomh00haha 10-02-2007 10:36

Re: button programming
 
this is a reply to move us to top.:]


All times are GMT -5. The time now is 10:03.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi