#Tank controlled by PS5 controller

1 messages · Page 1 of 1 (latest)

flint moon
#

Using some hacky knowledge, i wrote a CC program to control a tank with a ps5 controller.
The tank is nothing special, just a pair of treads controlled with CC and rotation speed controllers.

The clientside code (in computercraft) simply recieves the button and axis states of the controller, does some math on it, and then uses it to control the tank.

The serverside code reads the joystick state and sends it to CC with a websocket.
Please forgive my godawful code. this is my first successful websocket experiment.
The nature of this experiment means that it only runs on linux. windows users will have to write something in python or some other language to achieve the same result.
https://youtu.be/tcwIz-JlBkk

Mods used are Create, Valkyrien skies, Create: Big Cannons, Computercraft: tweaked, and VS: Trackwork. additional mods may be present but were not required for the operation of the device

▶ Play video
#

The server runs on luvit. i am not willing to help you troubleshoot if you wish to run this code yourself.

The serverside code presented runs on an amalgamation of example code and my own limited lua knowledge.
No AI was used in the making of this program

daring crane
#

Love how this looks

young coral
#

now make a submarine controlled by a ps5 controller

paper bison
#

Me when tweaked controllers trollface

paper bison
#

Its a mod that adds a linked controller with xbox/ps controller compat

flint moon
#

would've been nice to know about

#

but this has full analog support

paper bison
#

And divided by 15 (redstone strength)

flint moon
#

mine is divided by 65535

sage raven
white crypt
#

But yeah tweaked controllers allows you do do that in game
its still a cool thing to code, great job 3dsmile

#

Oh also, it fixes create blocks breaking when they are updated too many times (Im saying this because you probably have encountered it if you tried changing speed too quickly)

dreamy stag
#

Seriously impressive