Hey Everyone!
I have been working on a library to interface with a Playstation 2 controller using my Raspberry Pi. Raspberry Pi is an amazing brain for any robot so having a nice convenient way to interface with a wireless PS2 remote can make an awesome addition to any robot. I will be using it for my Pi controlled hexapod. Currently there is no functionality to enable rumble, I will hopefully be adding that soon. Also, obtaining the game controller state is kind of crude as you just need to access the public PS2data[] uint8_t array from the object. That will probably change soon too; but other than that it is working great.
You can find the most recent version at my github:
https://github.com/c-herring/PiPS2
And here is a video with a quick overview and some fun servo control:
– Chris
how you control the servo motor.?
where you write code for controlling of servo motor?
if i want to control the DC motor so where i do change in your library code ? or how can i used this button reading to control anything with python terminal ? please give sample example code.
Thank you
HI,
I was controlling the SSC32 servo controller via the serial port. The sample.cpp code on github shows how to read the buttons, but does not show how to control the servo because controlling the servo will be different for everyone – depending on what hardware you are using to control a servo.
To control the servo, I would just read the position of the analog stick and then put that position into a command string to send to the SSC32 controller over serial. You should be able to find a library to control whatever servo controller you are using, and then you can just do the same.
Unfortunately, this program is only in C++.