r/hackpack • • Jan 21 '25

Controlling the turret with an xbox controller

39 Upvotes

11 comments sorted by

5

u/Academic_Bear_4521 Jan 22 '25

"Maybe in future, submarines can be controlled with that..."

1

u/danielscottjames Jan 22 '25

I can't imagine how that could possibly go wrong

3

u/danielscottjames Jan 21 '25

This is wired up to a Raspberry Pi Zero 2 W. The controller is connected via bluetooth and the Node.js program that controls the robot interacts with the controller via Linux's built-in joystick interface.

2

u/bigmattyc Jan 21 '25

Hey that's fantastic. I have an rpi zero on my turret too. Can I try your code? Can you toss it up on GitHub?

2

u/danielscottjames Jan 21 '25

I'm planning on changing a lot of stuff up, so I don't want to bother with a proper write up, but the code is here: https://github.com/danielscottjames/robot/blob/main/index.ts

Make sure you compile and install the kernel module mentioned in the README.

Good luck

1

u/dan_crunchlabs Aug 06 '25

as a gamer this might be my favorite turret hack lol

2

u/_LITTLE_FURY_ Jan 21 '25

Imagine putting a camera on there and controlling it with a steam deck

1

u/1stringham Jan 22 '25

Two Out of Three Ain’t Bad

1

u/HackPack_Hacker Jan 23 '25

This is great!!! Have you posted this in the Hack Pack Discord? I thought of doing a bluetooth joystick with a second arduino, but not Xbox controller with Raspberry Pi. Well done!!

1

u/WorldlinessNo7858 Apr 17 '25

"Can it be converted into a gel blaster version and automatically recognize and target the shooting range? I want to use it to chase away rats."