C51 COMPILER V7.06 LCD1602 08/25/2014 08:48:54 PAGE 1
C51 COMPILER V7.06, COMPILATION OF MODULE LCD1602
OBJECT MODULE PLACED IN LCD1602.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE LCD1602.c BROWSE DEBUG OBJECTEXTEND
stmt level source
1 #include “LCD1602.h”
2
3 //****************************************************
4 //MS延时函数(12M晶振下测试)
5 //****************************************************
6 void LCD1602_delay_ms(unsigned int n)
7 {
8 1 unsigned int i,j;
9 1 for(i=0;i《n;i++)
10 1 for(j=0;j《123;j++);
11 1 }
12
13 //****************************************************
14 //写指令
15 //****************************************************
16 void LCD1602_write_com(unsigned char com)
17 {
18 1 LCD1602_RS = 0;
19 1 LCD1602_delay_ms(1);
20 1 LCD1602_EN = 1;
21 1 LCD1602_PORT = com;
22 1 LCD1602_delay_ms(1);
23 1 LCD1602_EN = 0;
24 1 }
25
26 //****************************************************
27 //写数据
28 //****************************************************
29 void LCD1602_write_data(unsigned char dat)
30 {
31 1 LCD1602_RS = 1;
32 1 LCD1602_delay_ms(1);
33 1 LCD1602_PORT = dat;
34 1 LCD1602_EN = 1;
35 1 LCD1602_delay_ms(1);
36 1 LCD1602_EN = 0;
37 1 }
38
39 //****************************************************
40 //连续写字符
41 //****************************************************
42 void LCD1602_write_word(unsigned char *s)
43 {
44 1 while(*s》0)
45 1 {
46 2 LCD1602_write_data(*s);
47 2 s++;
48 2 }
49 1 }
50
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉
全部0条评论
快来发表一下你的评论吧 !