Control Mario Kart With A Real Car

- by - in Games

Screen Shot 2017-03-23 at 20.55.03

Mario Kart 64 is a classic game that’s well known among geeks. It was designed long before steering wheel controllers, but there is a way to get a real feel for it… Use a car to control the game. Adam Ringwood and his team of hackers won HackIllinois by using the data from a car to control the in-game Mario Kart character.

All new cars must, by law, feature an OBDII port. This port sendsĀ useful diagnostic information over a serial connection, to a device that is set up to read it. Using this port you can readĀ fault codes, turn off your ‘check engine’ lights, and a host of other parameters of the car. This particular hack uses a Raspberry Pi hooked up to this OBDII port to read a few events, and map them to keyboard commands to control Mario Kart running in an emulator.

The script running alongside Mario Kart 64
The script running alongside Mario Kart 64

The core of the project’s code is based on two tools – cansiffer and candump. Cansniffer reads the data from the engine’s ECU in real time, and filters the data to remove duplicates and old data. Paired with candump, the ECU data can be converted from a hex dump, to a more human (and machine) readable format.

The Raspberry Pi reads the position of the steering wheel, brakes, windscreen wipers and headlights, and converts them into keystrokes via a python script. This is quite a big project, but it’s a great example of what can be done with a little bit of ingenuity.

If you would like to have a bit of fun with your own car, you can have a look at the source code for the project to try it out for yourself. It does take a bit of work (and the correct hardware), but once you start to read the data of your ODBII port, you open up a new world of possibilities. As Mario Kart’s controls are either on or off, there is no fine control of the movement, but if you hook it up to a more recent game, the sky’s the limit!

Adam RogersAdam RogersI am the the founder and editor of Codeduino. I'm a developer by trade, and a maker by night. I've been 'making' ever since being introduced to Arduino at university - my final year project was an Ableton Live controller based on Arduino.

SHARE THIS

Leave a Reply

Your email address will not be published. Required fields are marked *