1602 DS1302 可设闹钟万年历(5)
时间:2026-01-23
时间:2026-01-23
uchar code tab[]={0x18,0x1b,5,4,4,5,3,0, 0x08,0x0f,0x12,0x0f,0x0a,0x1f,0x02,0x02, 0x0f,0x09,0x0f,0x09,0x0f,0x09,0x11,0x00, 0x0f,0x09,0x09,0x0f,0x09,0x09,0x0f,0x00};
//年
//月 //日
/**************温度小数部分用查表法***************/ uchar code ditab[16]={0x00,0x01,0x01,0x02,0x03,0x03,0x04, 0x04,0x05,0x06,0x06,0x07,0x08,0x08,0x09,0x09}; /**************闹钟中用的全局变量***************/ uchar th1,tl1;
uchar temp_ioa[2]={0x00,0x00}; // 读出温度暂放 bit flag; //18b20存在标志位 /***********11微秒延时函数**********/ delay(uint t) {
for(;t>0;t--); }
/***********18B20复位函数**********/ ow_reset(void) { uchar i; DQ=1; _nop_();
单位 _nop_(); DQ=0; delay(50);
550us DQ=1;
//一个延时
// 延时
上一篇:淘宝客服质检评分
下一篇:物联网与近距离无线通信技术概述