单片机课程设计报告
{
us=0xf5 ;
while (us!=0){us-- ;} ; usn-- ; } MS-- ; } }
void LcmInit( void ) {
WriteCommand(0x30) ; //8BitMCU,基本指令集合
WriteCommand(0x03) ; //AC归0,不改变DDRAM内容
WriteCommand(0x0C) ; //显示ON,游标OFF,游标位反白OFF WriteCommand(0x01) ; //清屏,AC归0
WriteCommand(0x06) ; //写入时,游标右移动 }
void lcd_clear_one(void) {
unsigned char i; for(i=0;i<16;i++) WriteData(' '); }
//文本区清RAM函数 void LcmClearTXT( void ) {
unsigned char i ;
WriteCommand(0x30) ; //8BitMCU,功能设定,基本指令集合 WriteCommand(0x80) ; //AC归起始位 for(i=0 ;i<64 ;i++) WriteData(0x20) ;
}void setadd(unsigned char row,unsigned char col) {
WriteCommand(AC_TABLE[8*row+col]) ; }
void writeword(unsigned char row,unsigned char col,unsigned char * puts) {
WriteCommand(0x30) ; //8BitMCU,基本指令集合 WriteCommand(AC_TABLE[8*row+col]) ; //起始位置 while((*puts) != '\0') //判断字符串是否显示完毕 {
WriteData(*puts) ; puts++ ;