Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

This hack allows the tank plant to be controlled by a PS5 controller.

Required Materials

  1. A Raspberry Pi ( I'm using a Zero 2 W)
  2. A PlayStation 5 controller ( PS4 controller may work too, but you would have to change some things)
  3. A USB-C to USB-C cable

Instructions

  1. Use git clone https://github.com/Lukes-Lair/ps5-controlled-tank.git
  2. Get your controller's MAC address.
  • On Linux, use bluetoothctl devices
  • On Windows, connect the controller > open device manager > Bluetooth > right click your controller, and select properties > Details > click the properties drop down, then select Bluetooth device address > copy that value and put a ":" in between each 2 letters. For example, e15ytpq4h9 becomes e1:5y:tp:q4:h9.
  • On Mac, get a Windows computer -# or look here
  1. Get your Arduino port
  • To do this, you can run ls /dev/tty* before and after you plug your Arduino into the Raspberry Pi using the USB cable. Note whatever appeared when you ran that command after it was plugged in. It should look something like this /dev/ttyUSB0
  1. Put those 2 values in the start.py code on lines 6-7
  2. Run pip install pyserial pygame
  3. Upload the main.ino file to the tank plant
  4. Make sure the Raspberry Pi is connected to the Arduino using the USB cable (make sure you are using the same port as when you did step 3)
  5. Run the Python file using python start.py in the file's directory
  6. Put your controller into pairing mode by holding down the share and power buttons until it blinks.
  7. If you did it all right, it should auto-connect. Enjoy!

Notes

I did not use the screen to conserve battery. I'm not sure if it makes too much of a difference, but I did include the screen in the code in case you want to use it. This is my first Python and Raspberry Pi hack, so it might not be perfect. If using a PS4 controller, make sure to change the variables in the Python file

Controls

Use both joysticks to move their corresponding tread Use R1 to switch mode to use R2 and L2 to move forward and backward. Then use the joysticks to turn Use the arrow buttons to move the head Use the home button to home the head

About

A Hack for the Hack Pack Tank Plant that allows it to be controlled using a ps5 controller

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages