void WriteOneMotorCommand(float Comm, int index) { char str[70]; std::string write_command; sprintf(str,"%dla%d\rm\r",index+1,(int)(Comm*COUNT_RATIO[index])); write_command = str; //printf("%f\n",Comm); if( !_sport._write((uchar* )write_command.c_str(),write_command.length()) ) { printf("Error [Motor]: Cannot write command to motor %d suddenly\n",index); system("pause"); } }