Leap and N64 « My Site/Blog
Untitled Document

Leap and N64

I’ve been working on another silly project for the office that involves using a Leap Motion controller to replace the standard N64 one for certain games. The idea started with Mario Kart and using the roll and pitch of your hand to control the steering and acceleration. A simple google search turned up results for using an Arduino with a N64 controller, which provided instructions for using a N64 controller to control a N64 emulator running on your computer (also a fun project). This is done in two parts using an Arduino and Processing. The Arduino is first preloaded with code to parse the incoming controller data, which is transmitted in four byte chunks (you can google n64 protocol for more information on how the data is sent). The Arduino then passes the Processing script simple serial commands which it then turns into simulated key presses.

I decided to use the LeapMotionP5 library to integrate my controller . Once the leap is initialized, you can access most of the core functionality provided by the regular API. Initially I ran into a problem where the leap would stop sending tracking data if the Processing application was out of focus (I alt-tabbed to the emulator), which obviously didn’t help much. I emailed the creators of both libraries to see if their was a quick fix, and hear back from Cedric who worked on the P5 library who provided me with a one-line command flag enabling background frames. All I had to do then was map the left and right arrow key presses to left and right hand rolls. The same was done for acceleration and braking. Presto, use your hand to control the driving of your kart:

Right now the only buttons that are mapped are the acceleration/braking and left/right turns. It’s a little finicky and takes some getting used to but could definitely provide some additional amusement to classic games. All I have to do next is set processing to mirror the data it originally received from the Arduino, which will pipe it directly to a N64. I hope. Updates to come.

Untitled Document

1 comment

  1. none says:

    Clean you desk. Also, that lotion.

leave a response

Untitled Document