PDA

View Full Version : [Question(s)] Problem getting the position feedback WidowX



V├Čnz
02-01-2016, 04:05 AM
Hello,
I post this topic because i have the project to create a remote controller for the WidowX robot arm, but at the moment i need to get the position of servos and when i use the function of the ax12 librairie it return me a "-1" everytime. i'm using atmel studio. here is the code :

int main (void)
{
sei();
SetPosition(2,2048); //set the position of servo # 2 to '2048'
_delay_ms(1000);//wait for servo to move
SetPosition(3,2048); //set the position of servo # 3 to '2048'
_delay_ms(1000);//wait for servo to move
while(1)
{
if (GetPosition(3)==-1)
{
SetPosition(3,3072);
}
else
{
SetPosition(3,2048);

}

}
}

kgranat
02-02-2016, 11:47 AM
Can you make sure that all three jumpers(J1, J2, and the power jumper) are present on your board? (Especially J1)
Can you try the code in the Arduino environment to rule out any issued with atmel studio?