?? 1602.c
字號:
#include<absacc.h>
#include <AT89X51.h>
#include <intrins.h>
#define uchar unsigned char
#define uint unsigned int
uchar code lcd1[]={"input any press:"};
uchar code lcd2[]={"^-^ count: "};
uchar code lcd3[]={"0123456789abcdef"};
uchar d=0x00,e=0x00,i,j=0x00;
sbit RS=P2^0;
sbit RW=P2^1;
sbit EN=P2^2;
void Delay1ms( int ms)
{
int i;
while(ms--)
{
for(i = 0; i< 250; i++)
{
_nop_();
_nop_();
_nop_();
_nop_();
}
}
}
bit check()
{
bit busy;
RS=0;
RW=1;
EN=1;
_nop_();
_nop_();
_nop_();
_nop_();
EN=0;
return busy;
}
wzhilin(uchar zhi)
{
while(check());
RS=0;
RW=0;
EN=0;
_nop_();
_nop_();
P0=zhi;
_nop_();
_nop_();
_nop_();
_nop_();
EN=1;
_nop_();
_nop_();
_nop_();
_nop_();
EN=0;
}
wshuju(uchar shu)
{
while(check());
RS=1;
RW=0;
EN=0;
_nop_();
_nop_();
P0=shu;
_nop_();
_nop_();
_nop_();
_nop_();
EN=1;
_nop_();
_nop_();
_nop_();
_nop_();
EN=0;
}
chushihua()
{
wzhilin(0x38);
Delay1ms(1);
wzhilin(0x0c);
Delay1ms(1);
wzhilin(0x06);
Delay1ms(1);
wzhilin(0x01);
Delay1ms(1);
}
jishu(uchar k)
{
wzhilin(0x80|k);
wshuju(lcd3[j]);
j++;
Delay1ms(100);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -