reporting Wii Nunchuk data with boarduino?

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
Japper
 
Posts: 27
Joined: Mon Nov 26, 2007 4:36 pm

reporting Wii Nunchuk data with boarduino?

Post by Japper »

Is there a way to read and report Wii Nunchuk accelerometer data back to a PC with a boarduino? This uses the FTDI cable and I wasn't sure if this was possible or how to set it up...

anu ideas?

thanks

User avatar
adafruit_support_bill
 
Posts: 88089
Joined: Sat Feb 07, 2009 10:11 am

Re: reporting Wii Nunchuk data with boarduino?

Post by adafruit_support_bill »

There are plenty of examples of interfacing the nunchuck to an Arduino. The Boarduio is the same - just the pins are arranged differently.
Check out the Arduino playground on www.Arduino.cc
And this linkhas a lot of good detail.

Once you collect the data, just print it to the serial port to send it back to the PC.

Japper
 
Posts: 27
Joined: Mon Nov 26, 2007 4:36 pm

Re: reporting Wii Nunchuk data with boarduino?

Post by Japper »

I tried the code on the link and am getting the following error and not sure why...
'beginSerial' not declared in this scope

Code: Select all

#include <Wire.h>
#include <string.h>

#undef int
#include <stdio.h>

uint8_t outbuf[6];		// array to store arduino output
int cnt = 0;
int ledPin = 13;

void
setup ()
{
  beginSerial (19200);
  Serial.print ("Finished setup\n");
  Wire.begin ();		// join i2c bus with address 0x52
  nunchuck_init (); // send the initilization handshake
}


jdl2001
 
Posts: 86
Joined: Sun Mar 08, 2009 12:53 pm

Re: reporting Wii Nunchuk data with boarduino?

Post by jdl2001 »

Japper wrote:I tried the code on the link and am getting the following error and not sure why...
'beginSerial' not declared in this scope
[/code]
Serial.begin(19200);

Japper
 
Posts: 27
Joined: Mon Nov 26, 2007 4:36 pm

Re: reporting Wii Nunchuk data with boarduino?

Post by Japper »

I didn't see that typo on the page when I copied it.

Thanks for pointing that out!

Japper
 
Posts: 27
Joined: Mon Nov 26, 2007 4:36 pm

Re: reporting Wii Nunchuk data with boarduino?

Post by Japper »

Once I downloaded the FTDI chip set drivers I was able to upload the compiled
code into the arduino. At that point, when I connected the arduino to the USB on my laptop, it showed up as a virtual serial device in my windows device manager.

If I power the arduino from an external ac wall supply, and connect it to the USB, it becones an unknown device and the com port disappears.

Any ideas why that might be?

thanks

User avatar
adafruit_support_bill
 
Posts: 88089
Joined: Sat Feb 07, 2009 10:11 am

Re: reporting Wii Nunchuk data with boarduino?

Post by adafruit_support_bill »

Do you have the PWR SEL jumper set to "usb" or "ext"?

Japper
 
Posts: 27
Joined: Mon Nov 26, 2007 4:36 pm

Re: reporting Wii Nunchuk data with boarduino?

Post by Japper »

When I am powering the unit with USB and don't have the power brick attached,the PWR SEL jumper set to "usb" and when I am powering the arduino with the power brick and still connected to the USB, I set the PWR SEL jumper set to "ext".

In the PWR SEL "ext" jumper position, the USB is not recognized.

I am only using the USB for diagnostic purposes and the arduino will be powered by an external 12v battery with no USB connection.

By the way, I did measure the voltage on the arduino with both jumper settings and the +5v line measured +5v in both jumper settings...

Japper
 
Posts: 27
Joined: Mon Nov 26, 2007 4:36 pm

Re: reporting Wii Nunchuk data with boarduino?

Post by Japper »

I noticed the other day that Walmart has a generic 3rd party Wii nunchuk for ~ $12 which is pretty cheap considering the accelerometer chip inside would cost $30 by itself and for a measly $12 you get it mounted in an ergonomic case...

User avatar
adafruit_support_bill
 
Posts: 88089
Joined: Sat Feb 07, 2009 10:11 am

Re: reporting Wii Nunchuk data with boarduino?

Post by adafruit_support_bill »

We have them in the store here too: http://www.adafruit.com/products/342

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”