Read wii nunchuck data into arduino

With a little hacking, data can be read from a wii nunchuck directly into an Arduino, using TWI (aka I2C). The nunchuck contains a 3 axis accelerometer, joystick and buttons for only $19.95. The same accelerometer in kit form, cost $34.95 at Sparkfun. Plus the nunchuck is already wired up in a nice clean case! So the wii nunchuck should fit nicely into anyones robotic project.

Arduino Nunchuck

The nunchuck uses a proprietary connector. I just cut the end off of my nunchuck cable. The cable has 4 wires.
white - ground
red - 3.3+v
green - data
yellow - clock

Attach white to the Arduino's ground, red to 5 volt+, green to analog pin 4, yellow to analog pin 5. The nunchuck is only supposed to get 3.3+ volts. So far it has worked fine at 5 volts, but be warned. I am guessing that using the higher voltage will shorten the nunchucks lifespan.

My Arduino has an Atmel atmega168 chip. The atmega168 can read the TWI protocol. The "Wire" library is bundled with the Arduino IDE and contains a number of libraries that will be used for reading the TWI protocol. A few small changes have to be made to the default wire library. The Arduino's twi.h header needs two changes. Look in lib/targets/libraries/Wire/utility. Then delete twi.o. Open up twi.h. Uncomment line:
// #define ATMEGA8.

Since the nunchuck uses "Fast" I2C, we will need to change the default speed:
#define TWI_FREQ 400000L.

For the Arduino to communicate with the nunchuck, it must send a handshake. So first send 2 bytes "0x40,0x00". Then send one byte "0x00" each time you request data from the nunchuck. The data from the nunchuck will come back in 6 byte chunks.

Byte Description Values of sample Nunchuk
1 X-axis value of the analog stick Min(Full Left):0x1E / Medium(Center):0x7E / Max(Full Right):0xE1
2 Y-axis value of the analog stick Min(Full Down):0x1D / Medium(Center):0x7B / Max(Full Right):0xDF
3 X-axis acceleration value Min(at 1G):0x48 / Medium(at 1G):0x7D / Max(at 1G):0xB0
4 Y-axis acceleration value Min(at 1G):0x46 / Medium(at 1G):0x7A / Max(at 1G):0xAF
5 Z-axis acceleration value Min(at 1G):0x4A / Medium(at 1G):0x7E / Max(at 1G):0xB1
6 Button state (Bits 0/1) / acceleration LSB Bit 0: "Z"-Button (0 = pressed, 1 = released) / Bit 1: "C" button (0 = pressed, 1 = released) / Bits 2-3: X acceleration LSB / Bits 4-5: Y acceleration LSB / Bits 6-7: Z acceleration LSB

see wiili.org

Here is a simple program to read data from the nunchuck. It will read in data from the nunchuck then send it out over the Arduino's serial connection to your PC. On the PC, I just read it in with minicom, but you can use your favorite serial terminal program. The Arduino can't keep up with reading both serial and TWI at the same time. I have the Arduino read in about 50 bytes from the nunchuck then print that back to the PC over the serial connection. This means there will be a slight delay. Also you may see some strange characters every now and then. I think that is because of the serial connection interfering with the TWI connection.

Update: I updated the code some to slow down the serial data transmit and TWI requests. That seems to have fixed the bad data I was seeing.
If you are able to reproduce this hack, please drop me an email at chad AT chadphillips . org

#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
}

void
nunchuck_init ()
{
  Wire.beginTransmission (0x52);	// transmit to device 0x52
  Wire.send (0x40);		// sends memory address
  Wire.send (0x00);		// sends sent a zero.  
  Wire.endTransmission ();	// stop transmitting
}

void
send_zero ()
{
  Wire.beginTransmission (0x52);	// transmit to device 0x52
  Wire.send (0x00);		// sends one byte
  Wire.endTransmission ();	// stop transmitting
}

void
loop ()
{
  Wire.requestFrom (0x52, 6);	// request data from nunchuck
  while (Wire.available ())
    {
      outbuf[cnt] = nunchuk_decode_byte (Wire.receive ());	// receive byte as an integer
      digitalWrite (ledPin, HIGH);	// sets the LED on
      cnt++;
    }

  // If we recieved the 6 bytes, then go print them
  if (cnt >= 5)
    {
      print ();
    }

  cnt = 0;
  send_zero (); // send the request for next bytes
  delay (100);
}

// Print the input data we have recieved
// accel data is 10 bits long
// so we read 8 bits, then we have to add
// on the last 2 bits.  That is why I
// multiply them by 2 * 2
void
print ()
{
  int joy_x_axis = outbuf[0];
  int joy_y_axis = outbuf[1];
  int accel_x_axis = outbuf[2] * 2 * 2; 
  int accel_y_axis = outbuf[3] * 2 * 2;
  int accel_z_axis = outbuf[4] * 2 * 2;

  int z_button = 0;
  int c_button = 0;

 // byte outbuf[5] contains bits for z and c buttons
 // it also contains the least significant bits for the accelerometer data
 // so we have to check each bit of byte outbuf[5]
  if ((outbuf[5] >> 0) & 1)
    {
      z_button = 1;
    }
  if ((outbuf[5] >> 1) & 1)
    {
      c_button = 1;
    }

  if ((outbuf[5] >> 2) & 1)
    {
      accel_x_axis += 2;
    }
  if ((outbuf[5] >> 3) & 1)
    {
      accel_x_axis += 1;
    }

  if ((outbuf[5] >> 4) & 1)
    {
      accel_y_axis += 2;
    }
  if ((outbuf[5] >> 5) & 1)
    {
      accel_y_axis += 1;
    }

  if ((outbuf[5] >> 6) & 1)
    {
      accel_z_axis += 2;
    }
  if ((outbuf[5] >> 7) & 1)
    {
      accel_z_axis += 1;
    }

  Serial.print (joy_x_axis, DEC);
  Serial.print ("\t");

  Serial.print (joy_y_axis, DEC);
  Serial.print ("\t");

  Serial.print (accel_x_axis, DEC);
  Serial.print ("\t");

  Serial.print (accel_y_axis, DEC);
  Serial.print ("\t");

  Serial.print (accel_z_axis, DEC);
  Serial.print ("\t");

  Serial.print (z_button, DEC);
  Serial.print ("\t");

  Serial.print (c_button, DEC);
  Serial.print ("\t");

  Serial.print ("\r\n");
}

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

Update I just tried running my code under Arduino 10. I had to make a different change to twi.h. Here are the first few lines of twi.h
#define ATMEGA8

#ifndef CPU_FREQ^M
#define CPU_FREQ 16000000L
#endif

#ifndef TWI_FREQ^M
#define TWI_FREQ 100000L
#endif

Calibration

Does anyone know how to get the calibration data from the nunchuck?

Yes! It works.

I had a problem with this program with Arduino 0015. But I downloaded the new version 0016 from their homepage and now it works.
Thank you for sharing this great library.

I GOT IT TO WORK

woo i got it to work i had got the clock and signal the wrong waty round first time and then i got all the cionnections wrong on the wiichuck wrong but then i got it write and it all works =]

Pinout

What is pin 3 for on the Wiimote expansion port?

I am trying to connect a

I am trying to connect a nunchuck to AtMega168. The nunchuck responds with ACK when I start Master Transmit or Master Receive mode with 0x52, but when I try to send data (for example, 0x40) it won't respond ACK. (The 9th bit of data goes high, I checked with an oscilloscope.) I have tried with 100kHz, 200kHz and 400kHz, but it doesn't make any difference.

When I try to read from the nunchuck I get only FFs (nothing).

Any ideas how to continue?

I am facing exactly the same

I am facing exactly the same problem. Did you find a solution?

Lets see your code

Lets see your code

DS1307 Time date stamp with Wii Nunchack data log.

Hello, Thank you to all the Guys who contributed towards the super Wii Nunchack project.
I would like to know if anyone has worked on code to log a Date Time Stamp from the DS1307 together with the Nunchuck data? I just can't get my code to work with both I2C devices. All help very welcome.

Follow up

Awesome work folks. I'll be trying something similar over the next few days. Lots of good info in the comments. Thanks.

2 nunchucks with arduino

I got it to work:

Here is a website to the code and circuit:
http://www.wiimoteproject.com/tech-chat/2-nunchuck-with-arduino-help/

I couldn't of done it without help from this site
:0)

bd

THIS CODE IS FOR PICBASIC PRO

THIS CODE IS FOR PICBASIC PRO COMPILER, THE CODE PRINT THE BYTES ON LCD.

'****************************************************************
'* Name : UNTITLED.BAS *
'* Author : [select VIEW...EDITOR OPTIONS] *
'* Notice : Copyright (c) 2009 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 09/01/2009 *
'* Version : 1.0 *
'* Notes : read nunchuk, pic16f876, i2c=400kb *
'* : CLOCK: 20Mhz *
'****************************************************************
include "modedefs.bas"
DEFINE OSC 20
DEFINE I2C_HOLD 1

ADCON1=%00000110
trisa=%000000
trisb=%00000000
trisc=%00011110
porta=%000000
portb=%00000000
portc=%00000000

DEFINE LCD_DREG PORTA 'lcd pins
DEFINE LCD_DBIT 0
DEFINE LCD_RSREG PORTB
DEFINE LCD_RSBIT 7
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 5

SDA VAR PORTB.1
SCL VAR PORTB.2

a1 var byte
a2 var byte
a3 var byte
a4 var byte
a5 var byte
a6 var byte
b1 var byte
b2 var byte
b3 var byte
b4 var byte
b5 var byte
b6 var byte

LCDOUT $fe, 1
lcdout "prova i2c = "
pause 2000

XX: 'read nunchuk

i2cwrite sda,scl,$A4,$40,[$00]
pause 10
i2cwrite sda,scl,$A4,[0]
pause 10
i2cread sda,scl,$A5,[a1,a2,a3,a4,a5,a6]
pause 10

a1=(a1 ^ $17)+ $17 'decoder
a2=(a2 ^ $17)+ $17
a3=(a3 ^ $17)+ $17
a4=(a4 ^ $17)+ $17
a5=(a5 ^ $17)+ $17
a6=(a6 ^ $17)+ $17

if (a1<>b1)or(a2<>b2)or(a3<>b3)or(a4<>b4)or(a5<>b5)or(a6<>b6)then

LCDOUT $fe, 1
lcdout "d: ",#a1," ",#a2," ",#a3,$FE,$C0,#a4," ",#a5," ",bin a6
b1=a1
b2=a2
b3=a3
b4=a4
b5=a5
b6=a6

endif

pause 200

goto XX

END

Why do you use the $A5

Why do you use the $A5 address when you read the i2c data? I understand $A4 is necessary for 8 bit addressing but the www.wiili.org article does not mention a $A5 address.

awesome! Thanks for posting

awesome! Thanks for posting the code. What are you building with it?

output 0xFF 6 times

hello

I have read all the comments on this page but I can't get my nunchuck to work, the only thing dat comes out of the nunchuck is 255. I have put delays in my sequence, I use a 18F8723@20MHz PIC with microchip C18 compiler. The I2C bus works because I can read my I2C compass.

CODE
void Init_nunchuck(void){

Delay1KTCYx(100); //20ms Delay
i2c_start();
i2c_write(0xA4);
i2c_write(0x40);
i2c_write(0x00);
i2c_stop();

DLCD5MS; //5MS delay

i2c_start();
i2c_write(0xA4);
i2c_write(0x00);
i2c_stop();

Delay10TCYx(100); //200uS

i2c_start();
i2c_write(0xA5);
nunchuck[0]=i2c_read();
i2c_ack();
nunchuck[1]=i2c_read();
i2c_ack();
nunchuck[2]=i2c_read();
i2c_ack();
nunchuck[3]=i2c_read();
i2c_ack();
nunchuck[4]=i2c_read();
i2c_ack();
nunchuck[5]=i2c_read();
i2c_nack();
i2c_stop();
}

What Can I do to help the problem

Nunchuk + Processing help needed!

Hi! I got this hack to work as a charm, but I'm having trouble using the information in Processing. Anyone out there good at this? I really would need some general help, and maybe som basic examples! Thanx /NYX

Using your code in an Instructable

Hey;

Thank you chad for the great code to get a nunchuck connected to an Arduino. I've been having great fun with it. I have written up an Instructable about using a nunchuck to control a robot with an Arduino brain, and have used your code pretty much unchanged (many notes pointing people back here included) hope that's okay.

If you'd like to take a look;
http://www.instructables.com/id/How_to_Control_Your_Robot_Using_a_Wii_Nunchuck_an/

Thanks once more;
Stuart McFarlan
oomlout.com

Wireless Nunchuck not working

Hi, im trying to write an application that will use a wireless nunchuck. The nunchuck works fine with the wii but when i try and interface it with the code provided above, it will only display "Finished Setup" and one line of data in the serial program i am using and i have no idea why it stops. And i know its not a problem with the way i have implemented the code or the hardware because i have tried it with a normal nunchuck.

I have the same problem, but

I have the same problem, but I don't have a regular nunchuk to try with. And sise I dont have a wii i cant test the wireless nunchuck.

I do however get some kind of response, when the arduino is conected the conection lights stopped blinking on the resiver

Any ideas?

Wireless Wii nunchuck

hi, i am also in a similar situation. i bought a wireless nunchuck and at first i couldn't receive any data from it, i adapted the wire library as initially suggested above, twi_frequency = 400000L so i am now able to receive data but i am just getting " 255 255 1023 1023 1023 1 1" as an output regardless of how i maneuver the nunchuck. i was wondering if anyone else had encountered this problem either with a wired or wireless nunchuck and whether anybody could help me solve this issue.

Thanks

Exactly what is happening to

Exactly what is happening to me

I'm also having problems

I'm also having problems connecting to a wiireless nunchuck. I'm using a Logic 3 Freebird. there is an additional pin used on the wireless nunchuck, which is raised high when the connect button is pressed. On a wired nunchuck this is tied directly to 3.3V.

I can get data back from the wireless nunchuck, but its garbage, one thing I have found is that the wireless nunchuck will only work from 20000 to 100000 bps.

voltage control - use a LED

Thank you for the write-up. just what i needed.

you can drop the arduino's 5v to around 3.5V by sticking an LED between the +5 and the nunchuk. I got this idea from the schematic for the lilypad accelerometer which uses the same chip.

Nunchuck Stuck the arduino

I’m trying to do the same thing but I have a problem. When I connect the Wii Nunchuck to my arduino, it just stop ... I not receive any data from the arduino to the serial port when it connected. When I just disconnect the Nunchuck, the arduino is unblocked and I could receive data.

I just bought a new nunchuck so I’m pretty sure it not broken. Any idea? I’m stuck I can’t go ahead.

I use an Arduino diecimila, an original Nintento Nunchuck and the Wii Nunchuck Adaptor. I also use the lastest arduino software. I’m on Windows 7 pre-beta.

Can you use two numchucks ?

Howdy..
Thanks to your excellent work here we were able to get a wiimote numchuck talking to our arduino in about 15 minutes last night.. But we're a bit stuck on how to move forward.. We'd like to read from two different numchucks because we need two sets of joysticks for our application.. We haven't been able to figure otu how we'd interface a second numchuck into this approach. Is it possible to run 2 versions of the i2c interface on a single arduino.. We haven't been able to figure out where the pins are set.. etc. Any help would be much appreciated !!!
-jc

http://www.wiimoteproject.com

http://www.wiimoteproject.com/tech-chat/2-nunchuck-with-arduino-help/

Good question. The arduino

Good question. The arduino only has one I2C interface. You usually get around that by addressing your I2C slave. I don't know if you could do that with the nunchuck though. They may be hard set.

Maybe you could set up some type of transitor that would power off one of the nunchucks at a time. Then you could turn them on/off and only read one at a time.

Not sure if that would work, but might be worth a try.

I have no idea

I have no idea what to do. Your directions are not making any sense. What do i have to change in the wire lib. Please help.

Dead Wii Nunchuck?

First of all, thanks for all the great info, Chad!

I've been trying to get this working, but I hooked up the wires all wrong the first time (used the wrong pinout diagram). After fixing it, though, I still can't get any data from the nunchuck: the initialization routine hangs on Wire.endTransmission(...), which apparently indicates that the arduino did not receive a reply / acknowledge?

Do you think my nunchuck is dead? I've tried multiple combinations: all permutations of 5v/3.3v, 400khz vs 100khz, and switching the data and clock lines (since some diagrams on the internet have it the other way around).

Anyway, I'd appreciate any insight. Thanks!

The nunchuck is pretty tough.

The nunchuck is pretty tough. I have mis wired mine a few times and it still works. I would bet your nunchuck is ok.

What version of arduino software are you using? What os? Did you do the update to twi.h?

thanks
chad

Turns out it was dead: it had

Turns out it was dead: it had a short between clock and ground. I got a new one and it works fine now. I've been running it at 100khz / 3.3v on arduino-0011 (windows xp).

Thanks for the help!

Glad you got it working.

Glad you got it working. Please post back if you build anything interesting.

Sample C sources for Hi-Tech PICC 18 PRO and Microchip MPLAB C18

Sources for two popular compilers for the PIC 18F can be found at http://svn.stuytech.com/public/nunchuk_read/

All of the delays are nearly optimized to the bare minimum, so look here if you want to get the timing right. Also, check out the addressing and I2C rates.

Both code samples are targeting the 18F2550, with the config fuses set for a 20MHz crystal. The device will run at 48MHz (12 MIPS). Built hex files are available in Release/nunchuk_read.hex and within nunchuk_read_mcc18.zip.

I haven't licensed the code yet, so for now, please email me at xo HAT geekshavefeelings THE com DOT if you would like to use it.

This is the byproduct of a serious effort for a competition by a high school robotics team. Check out Stuyvesant Techtonics for more information: http://www.stuytech.com/

-Xo W.

Problem with using on Atmega32

Hey, I tried this on an atmega32 using the code above.
The only difference is that the FCU = 4000000.

Hyperterminal displays only

46 46 187 185 184 0 1

even as I move the nunchuck around

Any Ideas?

46 46 187 185 184 0 1

This mysterious sequence is actually what happens when the arduino runs the decoding sequence on a bunch of 00's. If I don't have anything hooked up I get that sequence.

Update

Ok, I checked the pins and I had the data and clock reversed

but now I get

255 255 1023 1023 1023 1 1

I saw someone else had this problem, but was it ever resolved?

I get those results if a pin

I get those results if a pin comes loose while the arduino is running. Lets say I am getting correct data, then I get a loose connection to the nunchuck. It then starts giving me the 255s.

I was say make sure you pins are all secure, then reset the arduino.

255

Don't know why but i get 255, too...Address 0xA4 should be right. Yesterday it had worked....

Doesn't seem to work with bit-banged i2c driver

I'm using a bit-banged i2c driver (found here: http://homepage.hispeed.ch/peterfleury/group__pfleury__ic2master.html#ga4 ) with an STK500 running an Atmega5815, but it doesn't seem to work. Using a logic analyzer, I can see that the Atmega is putting out the right bit pattern, according to my understanding of the i2c docs, but the Wiichuck never responds. Not even with an 'ack' (pulling the data line to low after the master finishes speaking) after sending 0x52. I've tried varying the speed of the data transmission, but to no avail.

I had the same problem using both the internal pull-up resistors in the wiichuck and external 4.7kOhm resistors. It seems that the wiichuck is dead to my i2c world. Except it still works just fine with the wiimote (i.e. I didn't fry nuttin').

Anyone have any ideas? This is really driving me crazy.

your using wrong address

When using I2C bus we address 7 bit devices. if you look at the code again at the hash defines near top youll see your device has address defined as 0xA2..therefore they already have the address shifted one tot he left here berfore adding the read or right bit at the end so what you must do is change this to 0xA4.When reading from the device you should see 0xA5 for the first byte sent and writing to the device will have 0xA4. This is because normally when reading and writing i2c our code handles the shift left before adding the read or write bit which id say yours is not doing.

Yup, that was it.

I figured out that it was 0xA4 by looking at the wiimote<--wiichuck data flow with the logic analyzer. I decided to google for why this was, and came across your answer! Dang, google is fast.

Strangely, when I monitor the wiimote<--wiichuck data response, there are 8 bytes, not 6, sent after 0xA5. I've taken a picture of the logic analyzer, and hope to have it posted to the wiki at wiili.org as soon as the admin gets around to seeing my email. I'd be interested if anyone can verify this and tell me what this is.

In any case, for the moment, I can't get the bit-banged code to do what I want it to, and assembly is too much of a headache for the moment (I'm new to microprocessors since last Friday) so one thing at a time. I ordered a couple Atmega644p's that have a twi interface built in, so I'll finally get it working.

Decoding of nunchuck data

Im using a blackfin evaluation system at present and connected to nunchuck through I2C. I noticed that there maybe errors in the code or posts on your site and was wondering could someone check and see if they are experiencing same issue:

when decoding buttons:

On osccilloscope i get the below truth table for Z and C buttons.

When not active the lsbs of the 6th register read 11.
When Z active the lsbs of the 6th register read 00.
When C active the lsbs of the 6th register read 01.
When Z.C active the lsbs of the 6th register read 10.

therefore the above coding will not give you correct button presses.

Also i would like to know has anyone correctly decoded the acceleration bits. is the 6th register made up to msbs or lsbs and in what order as the outputs dont match what is posted.

kelly

The button logic should be

The button logic should be right on. Debugging the code back to screen I can see for sure when I press the Z and C buttons.

I took my notes from:
http://www.wiili.org/index.php/Wiimote/Extension_Controllers/Nunchuk

Someone at wiili.org did get results like you are saying. If I had the buttons wrong, I would have thought I would have noticed it (I don't have my arduino handy to check).

You may be correct on the acceleration bits. I think someone else reports I had the LSBs reversed on acceleration.

Can you look at the data description at:
http://www.wiili.org/index.php/Wiimote/Extension_Controllers/Nunchuk

and see if it matches what you found?

thanks
chad

none chuck bits

yes i still have same issue so ill decode them the way im saying above. I managed to get the data for the other five bytes correct after decoding them . They basically drop the data in the 6th byte and dont use it. there for no i get a value on x axis of 74 - 178 y axis 72 - 184 and z 110 - 220 consistently . the joy values are consistent to . ill be happy enough to use these. However i have tried another processor and 8051 based and cant seem to get any data from it.

Back to the drawing board.

Working

I got this working, and have outputted the code to be interfaced with Visual Basic. If anyone is interested, I'll post a tutorial on my website.

Thanks!

Great write-up Chad, and it gave me all I needed to use the Nunchuk in my own project. I can control leaning in Call of Duty 4 using the Nunchuk (on my head). You can see a write-up on it here if you're interested. I reference this page a fair bit.

Thanks again!

How to change the code?

Thank you for your code. It is great.

I am doing a project which need to have two wiimotes at the same time. Data and clock wire of one wiimotes are attach to analog pin 4 and 5 respectively. However, data and clock wire of another wiimotes need to attach to another analog pin.

I would like to ask how to change the code for the data and clock wire which are not attached to analog pin 4 and 5.

Thanks

little rework on the print function ^^

little optimization of the print() function would be something like this :

int joy_x_axis = outbuf[0];
int joy_y_axis = outbuf[1];
int accel_x_axis = (outbuf[2] << 2) + ((outbuf[5] >> 2) & 0x03);
int accel_y_axis = (outbuf[3] << 2) + ((outbuf[5] >> 4) & 0x03);
int accel_z_axis = (outbuf[4] << 2) + ((outbuf[5] >> 6) & 0x03);
int z_button = outbuf[5] & 1;
int c_button = outbuf[5] & 2;

geting a nunchuck tomorrow and write some plain avrlibc examples :D

Exactly the same.

Wow, I got *exactly* the same code as you (down to the brackets even). Same shift, same AND with 0x03. Nice job.

Anyways, the only thing you want to do different is that c_button code. Right now it'll assign the value 0x02 to c_button if it's true and you want 1. Just use:

c_button = (outbuf[5] >> 1) & 0x01;

Sounds cool. Be sure and

Sounds cool. Be sure and post a link when you have your examples done.

underway

well :) got my nunchuk today and got a test version of some software running. must say out put is pretty jittery.
ow and there is no need to cut the connector off. made a neat male part using a sawed of piece of a ISA card 3 contacts wide and a bit of sanding. will post some pictures somewhere in a bit , but it works really great :)

BTW what is the time "delay(100);" cause ?

hmm and in your code (almost got the winavr code done)

doesn't

if ((outbuf[5] >> 2) & 1)
{
accel_x_axis += 2;
}
if ((outbuf[5] >> 3) & 1)
{
accel_x_axis += 1;
}

reverse the lower lsb and msb ?

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is used to make sure you are a human visitor and to prevent spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.