📄 lcdtest.c
字号:
#include "tftlcd.h"
#include <stdlib.h>
void main(void)
{
signed int t=12345;
uchar xpos;
uint ypos;
LCD_Init();//初始化液晶 ,带清屏函数
POINT_COLOR=0xf100;//画笔颜色
LCD_ShowString(50,100,"This is a test for TFTLCD!");
delay_ms(1000);
LCD_CLEAR(0,0,240,320);
srand(t);
while(1)//随机浮动图片
{
do{xpos=rand();}
while(xpos<0||xpos>120);//得到x坐标
do{ypos=rand();}
while(ypos<0||ypos>203);//得到y坐标
LCD_ShowBmp(xpos,ypos,120,117,gImage);//在0,0显示一幅图片
delay_ms(1000);
LCD_CLEAR(xpos,ypos,120,117);//清屏
};
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -