-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlcd.h
32 lines (24 loc) · 842 Bytes
/
lcd.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef __LCD_H_
#define __LCD_H_
//#define LCD1602_4PINS
#include<reg51.h>
#ifndef uchar
#define uchar unsigned char
#endif
#ifndef uint
#define uint unsigned int
#endif
#define LCD1602_DB P1
sbit LCD1602_RS = P2^5;
sbit LCD1602_RW = P2^6;
sbit LCD1602_EN = P2^7;
void Lcd1602_Delay1ms(uint c); //误差 0us
void Read_Busy(); //忙检测函数,判断bit7是0,允许执行;1禁止
void Lcd1602_Write_Cmd(unsigned char cmd); //写命令
void Lcd1602_Write_Data(unsigned char dat); //写数据
void LcdSetCursor(unsigned char x,unsigned char y); //坐标显示
void LcdShowStr(unsigned char x,unsigned char y,unsigned char *str); //显示字符串
void InitLcd1602(); //1602初始化
void clearLCD(); //屏幕清空
void LcdShowStrV1(unsigned char x,unsigned char y,unsigned char str);
#endif