How get Wii Nunchuck working? Tried several codes but no one is responding or do
hi guys , girls,
i wanna wii nunchuck working @ arudino board. tried several codes tutorials there no working one. got fake chuck , original 1 there no working one.
i tried data , clock @ pin 4 , 5.....and tried power @ original power pins , @ pin 2 , 3 in sketch. didnt tried thing pulldown resistors between power pins , data , clock pins.
can me? have define data , clock pins?
here codes tried:
http://hacknmod.com/hack/real-time-diy-pan-tilt-camera-with-arduino-wii-nunchuck/
http://www.windmeadow.com/node/42
http://todbot.com/blog/2008/02/18/wiichuck-wii-nunchuck-adapter-available/
i wanna wii nunchuck working @ arudino board. tried several codes tutorials there no working one. got fake chuck , original 1 there no working one.
i tried data , clock @ pin 4 , 5.....and tried power @ original power pins , @ pin 2 , 3 in sketch. didnt tried thing pulldown resistors between power pins , data , clock pins.
can me? have define data , clock pins?
here codes tried:
http://hacknmod.com/hack/real-time-diy-pan-tilt-camera-with-arduino-wii-nunchuck/
http://www.windmeadow.com/node/42
http://todbot.com/blog/2008/02/18/wiichuck-wii-nunchuck-adapter-available/
when "pin 2", "pin 3", "pin 4" , "pin 5" mean "pin a2", "pin a3", "pin a4" , "pin a5", right?
it worked fine me using demo code , wiichuck library:
it worked fine me using demo code , wiichuck library:
code: [select]
#include <math.h>
#include "wire.h"
#include "wiichuck.h"
#define maxangle 90
#define minangle -90
wiichuck chuck = wiichuck();
int anglestart, currentangle;
int tillerstart = 0;
double angle;
void setup() {
pinmode(a2, output);
digitalwrite(a2, low); // a2 = ground
pinmode(a3, output);
digitalwrite(a3, high); // a3 = vcc
//nunchuck_init();
serial.begin(115200);
chuck.begin();
chuck.update();
//chuck.calibratejoy();
}
void showbar(int value)
{
value = constrain(value ,-255, +255);
value += 255; // make range 0 512
(int i=0; i<16; i++)
serial.print(value >= i*(512/16) && value < (i+1)*(512/16) ?"*":" ");
}
void loop() {
delay(20);
chuck.update();
showbar(chuck.readroll());
showbar(chuck.readpitch());
showbar((int)chuck.readaccelx());
showbar((int)chuck.readaccely());
showbar((int)chuck.readaccelz());
serial.println();
}
Arduino Forum > Using Arduino > Programming Questions > How get Wii Nunchuck working? Tried several codes but no one is responding or do
arduino
Comments
Post a Comment