stm32f4 单片机 LCD tft显示屏 4*4矩阵按键
int main(void)
{
u8 key;
u8 lcd_id[12]; //´æ·ÅLCD ID×Ö·û´®
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);//ÉèÖÃϵͳÖжÏÓÅÏȼ¶·Ö×é2
delay_init(168); //³õʼ»¯ÑÓʱº¯Êý
uart_init(115200); //³õʼ»¯´®¿Ú²¨ÌØÂÊΪ115200
KEY_Init();
LED_Init(); //³õʼ»¯LED
LCD_Init(); //³õʼ»¯LCD FSMC½Ó¿Ú
POINT_COLOR=BLACK; //»±ÊÑÕÉ«£ººÚÉ«
sprintf((char*)lcd_id,"LCD ID:%04X",lcddev.id);//½«LCD ID´òÓ¡µ½lcd_idÊý×é¡£ while(1)
{
LCD_ShowString(30,40,210,24,24,"X=");
LCD_ShowString(30,80,210,24,24,"Y=");
key = KEY_Scan();
KEY_ShowNums(key);
}
}
评论