Shared posts

23 Mar 16:20

PREVIEWS: Get Revenge in "Django/Zorro" #5 & More Dynamite Comics on Sale March 25, 2015

Dynamite pushes new issues of their "Legenderry" series with "Green Hornet" #2, and read a new preview of the outlaws in "Django/Zorro" #5.
04 Jul 15:19

Connecting the NES Power Pad to the PC for its 25th Anniversary

by Staff
power pad.jpg[written by Archie Prakash]

Twenty-five years ago, on a bright and glorious day, the NES Power Pad was released to the US. Since the birth of home video game consoles, there have always been odd one-off peripherals to accompany gaming systems: the Amiga Joyboard for the Atari 2600, the Guitar Hero controller, the recent Xbox Kinect to name a few. They have been a welcome alternative to the classic controller or joystick.

Still, one of the greatest and widely distributed gaming peripherals of all time is arguably the Nintendo Power Pad. A flexible mat with 12 pressure sensitive buttons and two unique sides, it launched as the Family Trainer in Japan and was then rebranded as the Power Pad for release in the United States. Every child of the 80’s can remember the Nintendo Power Set, which was a NES bundle that featured the Power Pad. It was guaranteed to make you the most radical kid in the neighborhood.

But the Power Pad suffered the weakness of all console peripherals–a lack of support from developers and publishers. In total, six games were released in the US and a grand total of thirteen released worldwide. The most notable of these were World Class Track Meet, Athletics World, and Dance Aerobics. To this day, Power Pads are plentiful and can be found in massive quantities on eBay selling for as little as $20 with shipping! So as a dedication to our childhood and the 25th anniversary of this amazing video game peripheral, we at CyborgDino have figured out a way to connect this device to any PC, Mac and even a PS3 as a controller using an Arduino microcontroller. In addition, from what we can tell via a Google search, this is the first time a Power Pad has ever been connected to a desktop computer.

The rest of this article will outline steps and items required to create a USB hookup to the Power Pad.

A list of items required.

To start off, you want to take the NES extension cable and cut off the female end of the connector. It is possible to forgo the extension cable and just use the actual wire of the Power Pad, but by using the extension cable, you will have yourself a general purpose NES connector that you can use with any NES joystick, controller or peripheral. As a bonus, it will be magnitudes easier to find the proper pins of the device.

After separating out the internal wires of the extension cable, you will want to use the multimeter’s continuity setting to determine what wire corresponds to the pin-outs of the NES plug. Once determined which wire is which, a little masking tape was used to mark out the names for future reference. Trust us when we say this will save you loads of time down the road. The final step here is to solder on some hookup wires to the flayed ends of the NES cable; this will insure the best connection possible when connecting to the Arduino. Below is a snapshot of what you will end up with, and a basic reference for the NES controller pin-out.

powerpad01

The next step is connecting the Power Pad to the Arduino. Below, we have made a handy guide to help with connecting the hookup wires of the extension cable to the pins of the microcontroller. With our setup, we have chosen to use a breadboard to better help with prototyping and added a small LED to show when the system is powered up. Once that is complete, all that is left is connecting the Power Pad connecter to the extension cable and plugging in the Arduino to a computer.

powerpad02

Now comes the fun part, programming the Arduino. With a little help from the folks at nesdev.com, we were able to determine that the D3 and D4 pin-outs from the Power Pad are the key to reading all input from the device.

powerpad03

Finally, we were able to formulate the code, which boiled down to a loop reading a byte from the two pins at a 100 millisecond delay. An interesting note we found was a pad read as a 1 when not compressed and the bit was flipped to a 0 when it was stepped on . Later we ended up flipping all the bits by using a NOT operator on each byte after being read.

/* 
Reading a NES POWERPAD
By @CyborgDino
03 June 2013
LOS ANGELES, USA
*/

int latch = 2; // set the latch pin
int clock = 3; // set the clock pin
int data1 = 4; // set the data in pin
int data3 = 5;
int data4 = 6;

byte controller_data1 = 0;
byte controller_data3 = 0;
byte controller_data4 = 0;

/* SETUP */
void setup() {
  Serial.begin(9600);
  pinMode(latch,OUTPUT);
  pinMode(clock,OUTPUT);

  pinMode(data1,INPUT);
  pinMode(data3,INPUT);
  pinMode(data4,INPUT);

  digitalWrite(latch,HIGH);
  digitalWrite(clock,HIGH);
}

/* POWER PAD READ */
void controllerRead() {
  controller_data1 = 0;
  controller_data3 = 0;
  controller_data4 = 0;
  digitalWrite(latch,LOW);
  digitalWrite(clock,LOW);

  digitalWrite(latch,HIGH);
  delayMicroseconds(2);
  digitalWrite(latch,LOW);

  // D1 pin is unused 
  controller_data1 = digitalRead(data1);

  controller_data3 = digitalRead(data3);
  controller_data4 = digitalRead(data4);

  for (int i = 1; i 

By now, you may be asking “how can I now use this as a controller for my game of choice ?”. At first, we were going to write our own driver but then thanks to the Internet and the Open Source community we came across an awesome project called UnoJoy. Finding this nugget of code was an utter godsend. Within moments, we were able to convert our Arduino to a PS3 controller and the buttons for the controller were supplied by the Power Pad.

All code for this project can be found on our Github. As a bonus, we have taken the time to update the UnoJoy project for Mac developers, which was sorely needed for anyone using OSX 10.8. All updates can be found via the Github jump.

Now that the Power Pad was ours to command, anything was possible. We could maybe write some code to play Street Fighter 4 on the PS3 with only the Power Pad? We chose to take it one step further. Using some Unity 3D magic, we were able to prototype a two-player co-op game where you defend an area with a breakout style mechanic. So we present to you AXIS, what can be called the 14th game ever developed for the NES Power Pad.

We sincerely hope anyone reading this article will feel inspired to create a unique game of their own or adapt a pre-existing game to work with the Power Pad. If you take it so far, please let us know of your efforts on our twitter @cyborgdino. Long live the Power Pad and long live the NES!

This was originally posted at http://cyborgdino.com/2013/06/connecting-nes-power-pad-to-pc/ 

[Archie Prakash wrote this using sister site Gamasutra's free blogs]