51單片機時鐘12C887+溫度18b20C程序
本文引用地址:http://cqxgywz.com/article/201611/321018.htm#include
#define uchar unsigned char
#define uint unsigned int
sbit dula=P2^6;
sbit wela=P2^7;
sbit rs=P3^5;
sbit lcden=P3^4;
sbit s1=P3^0;//功能鍵選擇
sbit s2=P3^1;//數值加1
sbit s3=P3^2;//數值減1
sbit s4=P3^6;//鬧鐘查看設置鍵
sbit rd=P3^7;//
sbit beep=P2^3;//蜂鳴器
sbit dscs=P1^4;
sbit dsas=P1^5;
sbit dsrw=P1^6;
sbit dsds=P1^7;
sbit dsirq=P3^3;
sbit DQ=P2^2;
uint temp,tplsb,tpmsb;
uchar s1num,s4num,flag,flag1;
uchar miao,shi,fen,week,ri,yue,nian,amiao,afen,ashi;
uchar code table1[]="
uchar code table2[]="
uchar code table3[]={0xff,0x4d,0x54,0x57,0x54,0x46,0x53,0x53};
uchar code table4[]={0xff,0x4f,0x55,0x45,0x48,0x52,0x41,0x55};
uchar code table5[]={0xff,0x4e,0x45,0x44,0x55,0x49,0x54,0x4e};
void write_ds(uchar,uchar);
void set_alarm(uchar,uchar,uchar);
uchar read_ds(uchar);
//void set_time();
void read_alarm();
void delay(uint z)
{
}
void Delay_DS18B20(uint num)
{
}
void write_com(uchar com)
{
}
void write_date(uchar date)
{
}
void init()
{
//
//
}
void Init_DS18B20()
{
}
uchar ReadOneChar()
{
}
void WriteOneChar(uchar dat)
{
}


評論