单片机源程序如下:
- #include <reg51.h>
- #include <intrins.h>
- #include <sys\sys.h>
- #include <lcd\lcd.h>
- #include <font\font.h>
- /*
- 程序默认IO连接方式:
- sbit LCD_CS =P0^0; //片选
- sbit LCD_DC =P0^2; //数据/命令切换
- sbit LCD_SDI =P1^5; //数据
- sbit LCD_SCK =P1^7; //时钟
- sbit LCD_REST =P0^1; //复位
- */
- void xianshi()//显示信息
- {
- BACK_COLOR=WHITE;
- POINT_COLOR=RED;
- showhanzi(10,0,0,BRED); //晶
- showhanzi(45,0,1,GRED); //耀
- showhanzi(80,0,2,GBLUE); //郑
- showhanzi(125,0,3,RED); //秋
- showhanzi(160,0,4,YELLOW);//生
- LCD_ShowString(10,50,"1.52 inch TFT 240*240");
- }
- void showimage() //显示40*40图片
- {
- int i,j,k;
- xianshi(); //显示信息
- for(k=2;k<8;k++)
- {
- for(j=0;j<6;j++)
- {
- Address_set(40*j,40*k,40*j+39,40*k+39); //坐标设置
- for(i=0;i<1600;i++)
- {
- LCD_WR_DATA8(image[i*2+1]); //发送颜色数据
- LCD_WR_DATA8(image[i*2]);
- }
- }
- }
-
- }
- main()
- {
- Lcd_Init(); //tft初始化
- LCD_Clear(WHITE); //清屏
- BACK_COLOR=BLACK;
- POINT_COLOR=WHITE;
- while(1)
- {
- Lcd_Init(); //tft初始化
- LCD_Clear(RED);
- //delayms(1000);
- LCD_Clear(GREEN);
- ……………………
- …………限于本文篇幅 余下代码请从51黑下载附件…………
复制代码
所有资料51hei提供下载:
1.54 inch ST7793V 16K ROM的单片机).zip
(127.28 KB, 下载次数: 28)
|