给你们参考:
u8 Buffer_Scan1[8] = {0, 0, 0, 0, 0, 0, 0, 0};
u8 Buffer_Scan2[8] = {0, 0, 0, 0, 0, 0, 0, 0};
if(GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_12) == 0x00) //按键按下
{
Buffer_Scan1[2]=0x52; //key----> UP
while(GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_12) == 0x00) //按键持续按下
{
KeyBoard_Send(Buffer_Scan1,8);
delay(5); //延时5ms
}
KeyBoard_Send(Buffer_Scan2,8);
CoTickDelay(100);
delay(100); //延时100ms
} |