Submitted by Jon McPhalen (not verified) on Sat, 2008-01-05 16:43.
After reviewing Edward Holets' code and connecting a logic analyzer to the [working] Arduino, I decided to pad between bytes when reading from the nunchuck and that helps, though only the Y joystick value seems reliable. Thoughts?
Closer
After reviewing Edward Holets' code and connecting a logic analyzer to the [working] Arduino, I decided to pad between bytes when reading from the nunchuck and that helps, though only the Y joystick value seems reliable. Thoughts?
' Use: GET_NUNCHUCK
' -- read nunchuck values into array "joystick"
SUB GET_NUNCHUCK
I2C_START
I2C_OUT $A4
I2C_OUT $00
I2C_STOP
DELAY_MS 2
I2C_START
I2C_OUT $A5
DELAY_US 10
FOR tmpB1 = 0 TO 4
DELAY_US 10
joystick(tmpB1) = I2C_IN Ack
NEXT
DELAY_US 10
joystick(5) = I2C_IN Nak
I2C_STOP
ENDSUB