/* 根据键盘,做出相应的操作 */
switch(KEY_Scan())
{
case(KEY_UP):
if(m == 10)
{
CAN_SendData[10] = ~CAN_SendData[10];
}
else
{
CAN_SendData[m]++;
}
GUI_Show12Char(175, 84, "等待发送", RED, BLACK);
break;
case(KEY_DOWN):
if(m == 10)
{
CAN_SendData[10] = ~CAN_SendData[10];
}
else
{
CAN_SendData[m]--;
}
GUI_Show12Char(175, 84, "等待发送", RED, BLACK);
break;
case(KEY_LEFT):
if(m == 10)
{
m = 0;
}
else
{
m++;
}
break;
case(KEY_RIGHT):
CAN1_SendMesg(CAN_SendData[8], 8, CAN_SendData);//
发送数据
GUI_Show12Char(175, 84, "发送成功", BLUE, BLACK);
break;
default:
break;
}
} |