测试
//速度转换成标准的ID void SETV(int ID,float Vel,float Vel2,float Vel3) { char str[4]={0}; Candata[0]='S'; Candata[1]='E'; Candata[2]='T'; Candata[3]='V'; if(Vel<0) { Vel=(~(-Vel))+1; } Candata[4]=(Vel&(0xff)); Candata[5]=(Vel&(0xff00))>>8;; Candata[6]=(Vel&(0xff0000))>>16; Candata[7]=(Vel&(0xff000000))>>24; Candata[8]=(Vel&(0xff)); Candata[9]=(Vel&(0xff00))>>8;; Candata[10]=(Vel&(0xff0000))>>16; Candata[11]=(Vel&(0xff000000))>>24; Candata[12]=(Vel&(0xff)); Candata[13]=(Vel&(0xff00))>>8;; Candata[14]=(Vel&(0xff0000))>>16; Candata[15]=(Vel&(0xff000000))>>24; //0xD1,0x0F,0xC0,0x08,0x7E,0x90,0x00,0xF4,0x01,0x00,0x00} }
//速度转换成标准的ID void SETV(int ID,float Vel,float Vel2,float Vel3) { char str[4]={0}; Candata[0]='S'; Candata[1]='E'; Candata[2]='T'; Candata[3]='V'; if(Vel<0) { Vel=(~(-Vel))+1; } Candata[4]=(Vel&(0xff)); Candata[5]=(Vel&(0xff00))>>8;; Candata[6]=(Vel&(0xff0000))>>16; Candata[7]=(Vel&(0xff000000))>>24; Candata[8]=(Vel&(0xff)); Candata[9]=(Vel&(0xff00))>>8;; Candata[10]=(Vel&(0xff0000))>>16; Candata[11]=(Vel&(0xff000000))>>24; Candata[12]=(Vel&(0xff)); Candata[13]=(Vel&(0xff00))>>8;; Candata[14]=(Vel&(0xff0000))>>16; Candata[15]=(Vel&(0xff000000))>>24; //0xD1,0x0F,0xC0,0x08,0x7E,0x90,0x00,0xF4,0x01,0x00,0x00} }