打印

玩ILI9320的TFT

[复制链接]
505|11
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
dingy|  楼主 | 2018-12-22 18:20 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
当我每次写一个字符或汉字的话就没事,可写几个的时候就一直在闪,很难看清写的东西
沙发
chenjunt| | 2018-12-22 18:37 | 只看该作者
怎么实现的啊

使用特权

评论回复
板凳
dingy|  楼主 | 2018-12-22 18:40 | 只看该作者

我写多个字符或汉字是调用写一个字符或汉字的函数。

使用特权

评论回复
地板
ousj| | 2018-12-22 18:46 | 只看该作者
代码看看吧

使用特权

评论回复
5
yinxiangh| | 2018-12-23 13:49 | 只看该作者
函数名称CD_DispOneMaxChar
功    能://以16*24点阵显示一个字符
参    数:chr:   要显示的字符
     xStart:  要显示字符的起始X坐标
     yStart:  要显示字符的起始Y坐标
     fColor:  字符前景色
     bColor:  字符背景色
返 回 值:无
*************************************************************/
void LCD_DispOneMaxChar(unsigned char chr,unsigned int xStart,unsigned int yStart,
unsigned long fColor,unsigned long bColor)  
{
unsigned char i,j;
unsigned char nCols;
unsigned char nRows;
unsigned char nBytes;
unsigned int PixelRow;
unsigned int Mask;
unsigned long Word;
unsigned int *pFont;
unsigned int *pChar;
write_reg(0x03,0x0000); //Entry Mode Set.
// get pointer to the beginning of the selected font table
pFont = (unsigned int *)FONT16x24;

// get the nColumns, nRows and nBytes
nCols = *pFont;
nRows = *(pFont + 1);
nBytes = *(pFont + 2);

// get pointer to the first byte of the desired character
pChar = pFont + nBytes*(chr - 0x1F);

//define display window
Lcd_SetBox(xStart,yStart,nCols,nRows,0,0);

// loop on each row, working backwards from the top to the bottom
for (i = 0; i < nRows; i++)  
{
// copy pixel row from font table and then increment row
PixelRow = *pChar++;

// loop on each pixel in the row (left to right)
// Note: we do one pixel each loop
Mask = 0x0001;
for (j = 0; j < nCols; j++)  
{
// if pixel bit set, use foreground color; else use the background color
if ((PixelRow & Mask) == 0)
Word = bColor;
else
Word = fColor;
Mask = Mask << 1;
    rw_data_prepare();
    write_data(Word);

}
}
}
/*************************************************************
函数名称CD_DispMaxStr
功    能:以16*24点阵显示字符串
参    数:pStr:  字符串地址
xStart:  要显示字符串的起始X坐标
yStart:  要显示字符串的起始Y坐标
fColor:  字符前景色
bColor:  字符背景色   
返 回 值:无
*************************************************************/
void LCD_DispMaxStr(unsigned char *pStr,unsigned int xStart,unsigned int yStart,unsigned long fColor,unsigned long bColor)  
{
// loop until null-terminator is seen
while (*pStr != 0x00)  
{
// draw the character
LCD_DispOneMaxChar(*pStr++,xStart,yStart,fColor,bColor);
// advance the X position
xStart += 16;
// bail out if X exceeds LCD_HEIGHT
if (xStart > LCD_HEIGHT)  
break;
}
}

使用特权

评论回复
6
pengf| | 2018-12-23 16:11 | 只看该作者

没看代码。
刷屏太快了吧?
它正确写到屏上了,你眼睛反应不过来。

使用特权

评论回复
7
renyaq| | 2018-12-23 16:15 | 只看该作者
一次性把你要写的与到屏上,下次再写前等半秒。

使用特权

评论回复
8
liuzaiy| | 2018-12-23 16:17 | 只看该作者
多字的时候,字的区域叠加了,我遇到过。

使用特权

评论回复
9
kangzj| | 2018-12-23 16:21 | 只看该作者

字距放宽些,你16*24字体比较特殊,检查代码吧

使用特权

评论回复
10
ousj| | 2018-12-23 16:24 | 只看该作者

lz是用在PSOC上的吗??

使用特权

评论回复
11
dingy|  楼主 | 2018-12-23 16:27 | 只看该作者


哦,我看看吧

使用特权

评论回复
12
keaibukelian| | 2019-1-8 11:33 | 只看该作者
是不是刷新频率太高了啊

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

745

主题

10920

帖子

6

粉丝