
Im trying to get joystick 2 on the game controller to control rotation of the torso on my B9. I currently am controlling rotation by pressing button 4 for counterclockwise and button 2 for clockwise ( I have the commands PWM(D1, 4) for button 4 down and PWM(D1, 0) for button 4 up and PWM(D1, 11) for button 2 down and PWM(D1, 0 ) for button 2 up)
I have the diverse electronics controller connected with only one signal wire and I'm not really sure what mode it needs or is working in as I cannot find any documentation on it.
Experimenting with only the' X axis' Joystick 2 settings, when I assign it o digital port D1, I can get the torso to turn in either direction by changing the values in the 'min' and 'max' box but have no idea why or what its doing.
Anyone have any ideas on what may be happening and how I might set the 'min' and 'max' values to get the joystick to change the direction of rotation?
Would I need to use both the 'x axis' and 'y axis' maybe? I have no idea.
Im just trying to free up buttons so I can assign more MP3 options for this afternoon to interact with the tick or treaters.
There are normally blue question marks everywhere to hover your cursor over. Perhaps I'm missing one of those on something important in the joystick control that no one has noticed yet.
Thanks
I know that joystick 2 has variable speed positions (the harder you press, the faster the servos spin) but I want to limit the maximum speed, like you would do with the buttons setup that change speeds using servospeed() script, as joystick 2 doesn't seem to have the scripting option (not that I have seen anyway).
Any help on this would be greatly appreciated, as always.
Steve.
Sorry, I should have said but forgot to mention it *sleep*. No, I meant 180 deg servos.
Code:
Thanks for that. I'll give it a try tomorrow morning. One question, may be a silly one, where abouts do I enter the servo speed script you supplied above, as I cannot see how or where to enter script in the joystick 2 setup screen when I click the gear icon?
In this script you can set servo position, speed and set variables to default values as well.... etc
For the joystick script... Look at post# 5, second picture... This is where you would enter your button press script or scripts...
There is nothing on this page to enter scrips that I can see, only adjust "x" and "y" values.
The other post is regarding joystick buttons, not joystick 2.
Not really resolved just haven't had time to try a couple thoughts based on this discussion.
Just wanted Joystick 2 to cause the same action I currently get with buttons 2 set to down = PWM(D1, 11) up = PWM(D1, 0) and button 4 set to down = PWM(D1, 4) up = PWM(D1, 0)