欢迎来到天天文库
浏览记录
ID:55324380
大小:70.00 KB
页数:3页
时间:2020-05-10
《arm实验-TFTLCD显示实验test.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、#include"sys.h"#include"usart.h"#include"delay.h"#include"led.h"#include"beep.h"#include"key.h"#include"exti.h"#include"wdg.h"#include"timer.h"#include"tpad.h"#include"oled.h"#include"lcd.h"intmain(void){u8x=0;u8lcd_id[12];//存放LCDID字符串Stm32_Clock_Init(9);//系统时钟设置uart_init(72,9600);//串口初始化为9600dela
2、y_init(72);//延时初始化LED_Init();//初始化与LED连接的硬件接口LCD_Init();POINT_COLOR=RED;sprintf((char*)lcd_id,"LCDID:%04X",lcddev.id);//将LCDID打印到lcd_id数组。while(1){switch(x){case0:LCD_Clear(WHITE);break;case1:LCD_Clear(BLACK);break;case2:LCD_Clear(BLUE);break;case3:LCD_Clear(RED);break;case4:LCD_Clear(MAGENTA);bre
3、ak;case5:LCD_Clear(GREEN);break;case6:LCD_Clear(CYAN);break;case7:LCD_Clear(YELLOW);break;case8:LCD_Clear(BRRED);break;case9:LCD_Clear(GRAY);break;case10:LCD_Clear(LGRAY);break;case11:LCD_Clear(BROWN);break;}POINT_COLOR=RED;LCD_ShowString(30,50,200,16,16,"WarShipSTM32^_^");LCD_ShowString(30,70,200
4、,16,16,"TFTLCDTEST");LCD_ShowString(30,90,200,16,16,"ATOM@ALIENTEK");LCD_ShowString(30,110,200,16,16,lcd_id);//显示LCDIDLCD_ShowString(30,130,200,16,16,"2014/2/18");x++;if(x==12)x=0;LED0=!LED0;delay_ms(1000);}}
此文档下载收益归作者所有