ps3 buttonFastTurn not working
Forums:
I managed to pair my ps3 with my pi. All things are working fine. except my R2 button for controlling the turn speed doesn't work. I checked and I am certain that R2 is controlled by 9. everything is working also L2. But R2 doesn't seem to work? Any suggestions?
piborg
Tue, 12/27/2016 - 12:07
Permalink
Tank steering
Just to check if you hold down all of the following:
the DiddyBorg should spin on the spot.
The speed of the spin can be controlled by reducing how far forward the left stick is pushed.
When driving normally the rate of turning can be controlled by how far the right stick is pushed.
ray33
Sat, 12/31/2016 - 10:18
Permalink
Unfortunately that doesn't
Unfortunately that doesn't work. The diddyborg turns, but only the outer 3 wheels are spinning. Not the inner three ones!
piborg
Sat, 12/31/2016 - 13:21
Permalink
R2 not working
That is the behaviour we would expect if the R2 button is not working.
I would suggest trying to check if the controller is working.
Run this program from a terminal:
jstest /dev/input/js0
you should get a lot of lines of text, this is the current status of the controller.
Press and hold R2 and nothing else.
If R2 is working normally you should see
9:on
on the last line.In this case there is probably a problem with the script somewhere.
If R2 has a different number you should still see
:on
, but the number in front of it is not 9.In this case change the number in the script to the number you are seeing, then everything should work fine.
If R2 is not working you will not see
:on
anywhere on the last line.In this case the problem is with the controller, not with the script.
What you can do is change the script to look for a different button which is working, for example R1.
Press CTRL + C to end the program when you are done.
ray33
Wed, 01/04/2017 - 12:26
Permalink
This is the reply when i run
For the record. I tried to install my ps3 controller the way described on this site. It didn't work. Then i tried paring it via retropie setup for ps3. That worked. I can imagine that this could cause the r2 function not to work?
When i put in your command (jstest /dev/input/js0) I see that r2 states "on" when pressing.
piborg
Thu, 01/05/2017 - 11:01
Permalink
What is the button index?
What number is shown just before the
:on
?ray33
Thu, 01/05/2017 - 12:04
Permalink
Number 9.
Number 9.
piborg
Thu, 01/05/2017 - 13:46
Permalink
Python script not working
In that case it sounds like the script is the problem.
Have you made any changes to the script at all?
ray33
Thu, 01/05/2017 - 17:25
Permalink
I did't make any changes.
I did't make any changes.
piborg
Thu, 01/05/2017 - 18:53
Permalink
Script not working
Since you are sure the controller is working the problem must be with the script in some way.
Which script are you trying to use?
ray33
Thu, 01/05/2017 - 19:29
Permalink
I put this script in.
I put this script in.
piborg
Fri, 01/06/2017 - 11:26
Permalink
diddyRedJoy.py
That looks like the
diddyRedJoy.py
script to me.I cannot see anything wrong with the code for detecting button 9 (R2), it should be working.
What I would suggest is making a change so we can see if the script thinks R2 is pressed or not.
If you can add the three highlighted lines below into the code:
When you run the script it should write the detected R2 state to the screen.
It will either say:
R2 ON - tank steering
when R2 is pressed orR2 OFF - simple steering
when R2 is released.ray33
Fri, 01/06/2017 - 15:06
Permalink
I imported the lines and this
I imported the lines and this is what it shows
ray33
Fri, 01/06/2017 - 15:11
Permalink
dumb....
When I executed this script. It seems to be working. I don't know what script is running when i reboot the raspberry. But when i run the ps3diddyborgredjoy.sh it is working!
Sorry for the inconvenience.
piborg
Fri, 01/06/2017 - 16:52
Permalink
Glad you have found out what the issue is :)
No problem, I have made the same mistake myself before, it is easily done.