Arduino motor shield + wii nunchuck don't work at same time (FIXED)
fixed:
/////////////////////////////////////////////////////////////////////////////////////
solution
i spent weeks trying work. figures work post forum. sorry wasted forum post. interested, here solution
its embarrassingly simple. taking input nunchuck interrupted motors. accept input once in cycle, , delay() let motors run.
end solution
/////////////////////////////////////////////////////////////////
i have been stuck on problem long time. use help.
i have vehicle 2 motors. (left tread/right tread) , using arduino motor shield. both wii input, , motors work programmed. have tested them thoroughly.
however, if use wii nunchuck control motors, motors won't work when running themselves.
for instance:
this move backwards no problem
however, when this, recognizes should go backwards, motors behave strangely
i have had similar problems using ir remote control. there way can use input control motors? need do? be appreciated.
/////////////////////////////////////////////////////////////////////////////////////
solution
i spent weeks trying work. figures work post forum. sorry wasted forum post. interested, here solution
its embarrassingly simple. taking input nunchuck interrupted motors. accept input once in cycle, , delay() let motors run.
code: [select]
void loop(){
//accept nunchuck input
wiicontrol();
//control motors according input
move();
//delay motors give them time move
delay(200); // fixed it
}
end solution
/////////////////////////////////////////////////////////////////
i have been stuck on problem long time. use help.
i have vehicle 2 motors. (left tread/right tread) , using arduino motor shield. both wii input, , motors work programmed. have tested them thoroughly.
however, if use wii nunchuck control motors, motors won't work when running themselves.
for instance:
this move backwards no problem
code: [select]
void loop(){
movebackwards();
}
however, when this, recognizes should go backwards, motors behave strangely
code: [select]
void loop(){
nunchuck.update();
int down[] = { 128, 34 };
int joyx = nunchuck.joy_x();
int joyy = nunchuck.joy_y();
int offset = 20;
if(abs(joyy - down[1]) < offset && abs(joyx - down[0]) < offset){
serial.println("moving backward!");
movebackward();
}
i have had similar problems using ir remote control. there way can use input control motors? need do? be appreciated.
Arduino Forum > Using Arduino > Motors, Mechanics, and Power (Moderator: fabioc84) > Arduino motor shield + wii nunchuck don't work at same time (FIXED)
arduino
Comments
Post a Comment