欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136
標題:
超聲波液晶顯示
[打印本頁]
作者:
田鵬
時間:
2017-7-2 08:37
標題:
超聲波液晶顯示
#include <reg52.H>
#include <intrins.H>
#include <math.H>
#define uchar unsigned char
#define uint unsigned int
sbit dula = P2^6;//數(shù)碼管鎖存器關閉
sbit wela = P2^7;
sbit RS = P3^5; 顯示屏打開
sbit LCDEN = P3^4;
void delayUs()
{
_nop_();
}
void delayMs(uint a)
{
uint i, j;
for(i = a; i > 0; i--)
for(j = 100; j > 0; j--);
}
void writeComm(uchar comm)
{
RS = 0;
P0 = comm;
LCDEN = 1;
delayUs();
LCDEN = 0;
delayMs(1);
}
//寫數(shù)據(jù):RS=1, RW=0;
void writeData(uchar dat)
{
RS = 1;
P0 = dat;
LCDEN = 1;
delayUs();
LCDEN = 0;
delayMs(1);
}
void init()
{
dula = wela = 0;
writeComm(0x38); //顯示模式
writeComm(0x0c);//光標
writeComm(0x06); //光標位置,科左移
writeComm(0x01); //清屏
}
void writeString(uchar * str, uchar length)
{
uchar i;
for(i = 0; i < length; i++)
{
writeData(str[i]);
}
}
void main()
{
uchar table[] = " xianzaiwendu:";
init();
writeComm(0x80);
writeString(table, 16);
while(1)
{
}
復制代碼
作者:
黑泡泡
時間:
2021-5-18 12:51
程序有問題
作者:
51hei團團
時間:
2021-5-18 18:08
黑泡泡 發(fā)表于 2021-5-18 12:51
程序有問題
我在搜索框輸入"超聲波 1602"幫你搜索到了幾個能成功仿真的工程
http://www.raoushi.com/bbs/dpj-189056-1.html
歡迎光臨 (http://www.raoushi.com/bbs/)
Powered by Discuz! X3.1