lcdtest.c

来自「TFTLCD(驱动加资料) TFTLCD(驱动加资料)大大的好」· C语言 代码 · 共 37 行

C
37
字号
#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 + =
减小字号Ctrl + -
显示快捷键?