回复 2楼 peach5460
unsigned char Cmd[]= {0x40, 0x40, 0x00, 0x00, 0x0b, 0x01,
0x04,
//0x03 相对位移 0x04绝对位移
0,
//10,20,30,40,50,60 轴号
0, 0,
//加速度
0, 0, 0, 0,
//速度
0, 0, 0, 0,
//位移
0,
//标志位
0x23, 0x23};
unsigned char AddSum, SpeedSum, ShiftSum, CmdSum;
CmdSum = 0;
for(k=4;k<7;k++)
{
CmdSum +=Cmd[k];
}
E:\vcProgram\AllLed\AllLedDlg.cpp(732) : error C2109: subscript requires array or pointer type
E:\vcProgram\AllLed\AllLedDlg.cpp(732) : error C2297: '+=' : illegal, right operand has type 'void (__thiscall CAllLedDlg::*)(unsigned char *)'
错误指向
CmdSum +=Cmd[k]; 这一句。