Skip to content
Snippets Groups Projects
Commit 8b77ccad authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Small changes in the bioloid library example.

parent d82a36a9
No related branches found
No related tags found
No related merge requests found
......@@ -16,11 +16,12 @@ int main(int argc, char *argv[])
num_servos=tina.mm_get_num_servos();
std::cout << "Found " << num_servos << " servos" << std::endl;
// enable all servos and assign them to the action module
for(i=0;i<num_servos;i++)
for(i=1;i<=18;i++)
{
tina.mm_enable_servo(i);
tina.mm_assign_module(i,BIOLOID_MM_ACTION);
}
tina.mm_enable_power();
tina.mm_start();
// tina.imu_enable();
angles=tina.mm_get_servo_angles();
......@@ -28,7 +29,7 @@ int main(int argc, char *argv[])
std::cout << "Servo " << i << " angle: " << angles[i] << std::endl;
// execute an action
tina.action_load_page(32);
tina.action_load_page(31);
tina.action_start();
while(tina.action_is_page_running())
......@@ -37,6 +38,12 @@ int main(int argc, char *argv[])
angles=tina.mm_get_servo_angles();
for(i=0;i<num_servos;i++)
std::cout << "Servo " << i << " angle: " << angles[i] << std::endl;
count++;
if(count>50)
{
tina.action_stop();
count=0;
}
}
/* for(i=0;i<10;i++)
{
......@@ -56,6 +63,7 @@ int main(int argc, char *argv[])
}*/
// tina.imu_disable();
tina.mm_stop();
// tina.mm_disable_power();
}catch(CException &e){
std::cout << e.what() << std::endl;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment