51單片機(jī)電子時(shí)鐘程序
#include
#include
#include
#define uint unsigned int
#define uchar unsigned char
sbit RS=P2^0;
sbit RW=P2^1;
sbit E=P2^2;
sbit BF=P0^7;
sbit d=P2^3;
unsigned char code string[]={"Test Result"};
unsigned char code digit[]={"0123456789"};
void delay1ms()
{
unsigned char i,j;
for(i=0;i<10;i++)
for(j=0;j<33;j++);
}
void delay(unsigned char n)
{
unsigned char i;
for(i=0;i
}
評論