b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

开源蓝牙协议栈_蓝牙 协议栈 开发_蓝牙协议栈详解(10)

电脑杂谈  发布时间:2017-02-11 05:12:34  来源:网络整理

static void LCD12864_SetAddr(uint8 line, uint8 col)

{

uint8 ucLine, ucRow;

//line += 5;

col += 4;

if((line >= LCD12864_MAX_LINE) || (col >= LCD12864_MAX_ROW))

{

return;

}

ucLine = LCD_CMD_PAGE_LINE | (line&0x0f);

LCD12864_Cmd(ucLine);

SoftWaitUs(15);

ucRow = LCD_CMD_ROW_HIG | (col>>4);

LCD12864_Cmd(ucRow);

SoftWaitUs(15); // 15 us

ucRow = LCD_CMD_ROW_LOW | (col&0x0f);

LCD12864_Cmd(ucRow);

SoftWaitUs(15); // 15 us

}

static void LCD12864_Dis5X8(char ch)

{

uint8 ucCnt;

if((ch >= 0x20)&&(ch <0x7f))

{

uint8 ucChar = ch - 0x20;

for(ucCnt=0; ucCnt《5; ucCnt++)

{

LCD12864_Dat( aucAsciiTable5x7[ucChar][ucCnt]);

}

//LCD12864_Dat(0x00);

}

else if(ch==0x00) //不需要显示,清空指定位置

{

for(ucCnt=0; ucCnt《5; ucCnt++)

{

LCD12864_Dat(0x00);

}

}

LCD12864_Dat(0x00);

}

void LCD12864_Clear(void)

{

uint8 ucLine, ucRow;

for(ucLine=0; ucLine《LCD12864_MAX_LINE; ucLine++)

{

LCD12864_SetAddr(ucLine, 0);

for(ucRow=0; ucRow《LCD12864_MAX_ROW; ucRow++)

{

LCD12864_Dat(0x00);

}

}

}

void LCD12864_DisChar(uint8 line, uint8 col, char ch)

{

if (( line <HAL_LCD_MAX_LINES)&&(col <HAL_LCD_MAX_CHARS))

{

LCD12864_SetAddr(line, col*HAL_LCD_FONT_ROWS);

LCD12864_Dis5X8(ch);

}

}

void LCD12864_DisStr(uint8 line, char* pStr)

{

uint8 ucCnt = 0;

for ( ucCnt = 0 ; ucCnt <HAL_LCD_MAX_CHARS; ucCnt++ )

{

if ( ’\0‘ == *pStr )

{

break;

}

LCD12864_DisChar( line, ucCnt, pStr[ucCnt]);

}

for ( ; ucCnt <HAL_LCD_MAX_CHARS; ucCnt++ )

{

LCD12864_DisChar( line, ucCnt, 0);

}

}

主程序:

int main(void)

{

/* 启动外部晶振 */

SysStartXOSC();

/* LCD12864的初始化 */

LCD12864_Init();

/* 清屏 */

LCD12864_Clear();

while(1)

{

/* 显示字符 */

LCD12864_DisStr(3, ”ShenZhenShiManTouKeJi“);

}

return 0;

}

这样我们就点亮的LCD12864屏幕


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/tongxinshuyu/article-31732-10.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    每日福利
    热点图片
    拼命载入中...