⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lcd1602.c

📁 驱动ADUC845进行AD采样
💻 C
字号:
#include "lcd1602.h"
/*void checkbusy(void)
{lcd=0xff;
 enable=0;
 rw=1;
 rs=0;
 enable=1;
 delay(100);
 while(lcd&busy);
 enable=0;
}*/
/************延时函数*/
void Delay(uint i)
{
  while(i--);
}
/*写指令函数*/
void Write_Instruction(uchar x)
{
 Delay(1000);
 E=0;
 RW=0;
 RS=0;
 LCDData=x;
 E=1;
 Delay(20);
 E=0;
 }
/*写单个数据的函数*/
void Write_Data(uchar x)
{
 Delay(1000);
 E=0;
 RW=0;
 RS=1;
 E=1;
 LCDData=x;
 E=0;
}
/*清屏函数*/
void Cls(void)
{
  Write_Instruction(0x01);
}
/*写入一串字符串函数*/
void Write_String(uchar x,uchar *p)
{ Write_Instruction(x);
  while(*p!=0x00)
 {Write_Data(*p);
  p++;
  if (x++==0x8f)
  {Write_Instruction(0xc0);}
 }
}
/*初始化函数*/
void InitLCD(void)
{Write_Instruction(0x38);
 Delay(200);
 Write_Instruction(0x0e);
 Delay(200);
 Write_Instruction(0x06);
 Delay(200);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -