Thunderborg and ps4 controller

I have attempted to control my thundeborg via a ps4 controller yet it does not seem to work. How would be able to control the speed of my motors via a ps4 controller?
Thanks

piborg's picture

We actually have an example of this already :)

If you take a look at our Gamepad library on GitHub it has an example called monsterJoy.py. This example controls a ThunderBorg, and by default it reads inputs from a PS4 controller.

When I ran this code it worked for 30 seconds but then my pi just turned off and the program stopped working. What may have caused this?

piborg's picture

Usually the Pi suddenly powering off indicates that the batteries are starting to get flat. What happens is that the motors take most of the battery power when they are moving, and there is not enough left for the Raspberry Pi to get a stable 5V. In this case recharging the batteries should get things running again :)

If you are not using a MonsterBorg you should also check the values for voltageIn and voltageOut in the script are correct for your robot.

Subscribe to Comments for "Thunderborg and ps4 controller"