""
All times are GMT -5. The time now is 03:10 PM.  

Go Back   WiiNewz Forums > Nintendo Wii Forums > Wiimote Hacking

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-22-2008, 10:47 PM
Registered User
 
Join Date: Feb 2008
Posts: 37
Default Cheap wiimote connector?

Hi, this summer I plan on making my own Guitar Hero guitar, but one of the biggest problems I can see is connection to the wiimote. That wouldn't be so hard if I didn't mind ripping the cable off a nunchuk, but thats quite expensive for a connector, so I'd prefer not to do that. Does anyone know where I can get a connector cheap? Somewhere that has broken nunchuks or something...

Any help is appreciated, thanks.
Reply With Quote
  #2 (permalink)  
Old 06-23-2008, 07:19 AM
Registered User
 
Join Date: Jul 2007
Location: long island
Posts: 801
Default

ebay or find the nunchuck extension cables would be the easiest.
__________________
Get yourself, and help get me, a PS3 for free (stamps.com, cancel after 22 days)
Dub's Outlet
D2B w/ YAOSM, THANKS BELL!
launch ps2 w/ flip top and swap magic
Reply With Quote
  #3 (permalink)  
Old 06-24-2008, 05:59 AM
Junior Member
 
Join Date: Jun 2008
Posts: 1
Default

The spacing on the pins looks similar to isa card spacing, maybe you could shave a socket down a bit to fit

Last edited by ximon; 06-24-2008 at 06:07 AM.
Reply With Quote
  #4 (permalink)  
Old 06-24-2008, 08:41 PM
Registered User
 
Join Date: Feb 2008
Posts: 37
Default

I think I'm just gonna buy an extension cable. I found one on ebay for $8 with shipping And I can use the second half to connect to the nunchuk. (My friend used that as his controller for his "robot", I'm gonna do the same )

A firewire connector fits, and it looks like the pins contact each other, but it's not a good connection.

ISA connector might work for the nunchuk, but I want to connect to the wiimote (Unless I'm not seeing something that you are)

Thanks for the replies
Reply With Quote
  #5 (permalink)  
Old 07-04-2008, 05:48 PM
Senior Member
 
Join Date: Apr 2008
Posts: 143
Default

The nunchak extender cables are your best option but how about the schematics for the guitar? Doesn't it use some kind of controller?
I'm interested if you have some more infos!
Reply With Quote
  #6 (permalink)  
Old 07-04-2008, 07:06 PM
Senior Member
 
Join Date: May 2008
Posts: 153
Default

yeah i would like to know how this is done, more info please.
Reply With Quote
  #7 (permalink)  
Old 07-05-2008, 03:35 PM
Senior Member
 
Join Date: Apr 2008
Posts: 143
Default

This is what I found out about talking to a Wii Guitar. I'll study it further and see if it can be used to emulate a wii guitar. I'm planning to use a cheap PIC 16F690.

Code:
/*
  Wii Guitar functions library - Arduino meets Wii Guitar (sold/used with Guitar Hero 3)
 
  2008 Jason Leyrer - http://www.jleyrer.net
 
  This library is an adaptation of Tod E. Kurt's (http://todbot.com/blog/) Wii Nunchuck 
  functions lib, which uses Wii Nunchuck reading code originally from Windmeadow Labs
  (http://www.windmeadow.com/node/42). 

  Questions/Suggestions? Email me at jleyrer [a] gmail.com
  
*/

#include <Wire.h>

static uint8_t guitar_buf[6];   // array to store guitar data,

// initialize the I2C system, join the I2C bus,
// and tell the guitar we're talking to it
static void guitar_init()
{ 
    Wire.begin();                // join i2c bus as master
    Wire.beginTransmission(0x52);// transmit to device 0x52
    Wire.send(0x40);// sends memory address
    Wire.send(0x00);// sends sent a zero.  
    Wire.endTransmission();// stop transmitting
}

// Send a request for data to the guitar
static void guitar_send_request()
{
    Wire.beginTransmission(0x52);// transmit to device 0x52
    Wire.send(0x00);// sends one byte
    Wire.endTransmission();// stop transmitting
}

// Encode data to format that most wiimote drivers except
// only needed if you use one of the regular wiimote drivers
static char guitar_decode_byte (char x)
{
    x = (x ^ 0x17) + 0x17;
    return x;
}

// Receive data back from the guitar, 
// returns 1 on successful read. returns 0 on failure
static int guitar_get_data()
{
    int cnt=0;
    Wire.requestFrom (0x52, 6);// request data from nunchuck
    while (Wire.available ()) {
        // receive byte as an integer
        guitar_buf[cnt] = guitar_decode_byte(Wire.receive());
        cnt++;
    }
    guitar_send_request();  // send request for next data payload
    // If we recieved the 6 bytes, then go print them
    if (cnt >= 5) {
        return 1;   // success
    }
    return 0; //failure
}

// Print the input data we have recieved
static void guitar_print_data()
{ 
    static int i=0;
    int joy_x_axis = guitar_buf[0];
    int joy_y_axis = guitar_buf[1];
    // guitar_buf[2] isn't used, as far as I can tell
    int whammy_bar = guitar_buf[3]; // only least significant four bits are used
    
    // The rest of the bytes are shared by the guitar's buttons
    
    int strum_up = (guitar_buf[5] >> 0) & 1;
    int strum_down = (guitar_buf[4] >> 6) & 1;
    int minus_button = (guitar_buf[4] >> 4) & 1;
    int plus_button = (guitar_buf[4] >> 2) & 1;
    int green_button = (guitar_buf[5] >> 4) & 1;
    int red_button = (guitar_buf[5] >> 6) & 1;
    int yellow_button = (guitar_buf[5] >> 3) & 1;
    int blue_button = (guitar_buf[5] >> 5) & 1;
    int orange_button = (guitar_buf[5] >> 7) & 1;
      
    Serial.print("Joystick: ");
    Serial.print("x=");
    Serial.print(joy_x_axis,DEC);
    Serial.print(" y=");
    Serial.print(joy_y_axis, DEC);
    Serial.print("  |  ");

    Serial.print("Green: ");
    Serial.print(green_button,DEC);
    Serial.print("  ");
    
    Serial.print("Red: ");
    Serial.print(red_button,DEC);
    Serial.print("  ");
    
    Serial.print("Yellow: ");
    Serial.print(yellow_button,DEC);
    Serial.print("  ");
    
    Serial.print("Blue: ");
    Serial.print(blue_button,DEC);
    Serial.print("  ");
    
    Serial.print("Orange: ");
    Serial.print(orange_button,DEC);
    Serial.print("  |  ");
    
    Serial.print("D-Strum: ");
    Serial.print(strum_down,DEC);
    Serial.print("  ");
    
    Serial.print("U-Strum: ");
    Serial.print(strum_up,DEC);
    Serial.print("  |  ");
    
    Serial.print("Whammy Bar: ");
    Serial.print(whammy_bar, DEC);
    Serial.print("  |  ");
    
    Serial.print("(+) Knob: ");
    Serial.print(plus_button,DEC);
    Serial.print("  ");
    
    Serial.print("(-) Knob: ");
    Serial.print(minus_button,DEC);
    
    Serial.print("\r\n");  // newline
    i++;
}

/*
    Colored Fret Buttons
*/

// returns green button state: 1=pressed, 0=notpressed
static int guitar_green_button()
{
    return ((guitar_buf[5] >> 4) & 1) ? 0 : 1;
}

// returns  red button state: 1=pressed, 0=notpressed
static int guitar_red_button()
{
    return ((guitar_buf[5] >> 6) & 1) ? 0 : 1;
}

// returns yellow  button state: 1=pressed, 0=notpressed
static int guitar_yellow_button()
{
    return ((guitar_buf[5] >> 3) & 1) ? 0 : 1;
}

// returns blue button state: 1=pressed, 0=notpressed
static int guitar_blue_button()
{
    return ((guitar_buf[5] >> 5) & 1) ? 0 : 1;
}

// returns orange button state: 1=pressed, 0=notpressed
static int guitar_orange_button()
{
    return ((guitar_buf[5] >> 7) & 1) ? 0 : 1;
}

/*
    Joystick
*/

// returns value of x-axis joystick
static int guitar_joyx()
{
    return guitar_buf[0]; 
}

// returns value of y-axis joystick
static int guitar_joyy()
{
    return guitar_buf[1];
}

/*
  Strum Direction
*/

// returns downward strum state (pushing down on the strum bar): 1=pressed, 0=notpressed
static int guitar_strum_down()
{
    return ((guitar_buf[4] >> 6) & 1) ? 0 : 1;
}
// returns upward strum state (pushing up on the strum bar): 1=pressed, 0=notpressed
static int guitar_strum_up()
{
    return ((guitar_buf[5] >> 0) & 1) ? 0 : 1;
}

/*
    Plus/Minus Knob Buttons
*/

// returns minus (-) button state: 1=pressed, 0=notpressed
static int guitar_minus_button()
{
    return ((guitar_buf[4] >> 4) & 1) ? 0 : 1;
}
// returns plus (+) button state: 1=pressed, 0=notpressed
static int guitar_plus_button()
{
    return ((guitar_buf[4] >> 2) & 1) ? 0 : 1;
}

/*
    Whammy Bar
    
*/

// return whammy bar postion: value ranges from 240 (0xF0) when the bar is at rest
// to 250 (0xFA) when the bar is pressed all the way down.
static int guitar_whammy_bar()
{
  return guitar_buf[3];
}
Reply With Quote
  #8 (permalink)  
Old 07-07-2008, 08:12 PM
Junior Member
 
Join Date: May 2008
Posts: 6
Default cost?

How much are you spending on the electronic components all told? I've been considering DIYing a guitar, and I have a shell I can use, but if it will cost more than the real thing I'll just buy it (and then I'll know for sure that its going to work right).
Reply With Quote
  #9 (permalink)  
Old 07-08-2008, 03:47 AM
Senior Member
 
Join Date: Apr 2008
Posts: 143
Default

Cost:
10$ - nunchak extension cable shipped
3$ - 16F690
10$ - buttons, few LEDs and some SMDs

add a guitar to these prices or make one yourself (if you want a guitar at all).
Reply With Quote
  #10 (permalink)  
Old 07-09-2008, 08:40 AM
Junior Member
 
Join Date: May 2008
Posts: 6
Default main circuit board

cool.

I found a site where I can buy a main circuit board replacement for $12 shipped. Since I already have plenty of buttons, etc., it should come to about the same cost.

I don't think wiring a nunchuck extension cable to a PS2 circuit board will be too much of a problem, so the hardest part is going to be making a strum bar and a whammy bar.
Reply With Quote
Reply
Sponsors

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -5. The time now is 03:10 PM.