標(biāo)題: 51單片機(jī)1602程序 [打印本頁(yè)]

作者: 保持微笑    時(shí)間: 2020-10-17 16:07
標(biāo)題: 51單片機(jī)1602程序
51單片機(jī)控制1602進(jìn)行簡(jiǎn)單顯示一串字符
#include<reg52.h>
#define uint unsigned int
#define uchar unsigned char
sbit rs=P2^0;
sbit sn=P2^2;    //說(shuō)明rw直接連接5V地
void zs(uchar w,e)//指令和數(shù)據(jù)
{
            rs=w;
            P0=e;
            sn=1;
            ys(10);
            sn=0;
}
void csh()
{
            zs(0,0x38);                 
            zs(0,0x0c);
            zs(0,0x06);
            //zs(0,0x01);//清屏指令
            zs(0,0x80);
}

1602液晶.zip

13.23 KB, 下載次數(shù): 21, 下載積分: 黑幣 -5






歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1