这是我分享别人的一个资源,觉得不错传上来共享一下。里面有完整的论文,以及程序。想做体温计的朋友可以借鉴下。
#include
#include
#include
#define uchar unsigned char
#define uint unsigned int
uchar code dis_code[10]={0xc0,0xf9,0xa4,0xb0, // 0, 1, 2, 3
0x99,0x92,0x82,0xf8,0x80,0x90}; // 4, 5, 6, 7, 8, 9, off
uchar data set_data[3]={0x00,0x07,0x03}; //预设37.0度
uchar data ad_data; //AD转换结果
uchar data dis_buf[3]={0x00,0x00,0x00}; // 显示缓冲区
uchar data bcd_buf[3]={0x00,0x00,0x00}; //十进制BCD码转换存放区
uchar data TIMER0_NUM;
bit TIMER0_flag;
bit data set_flag=0;
sbit ALE=P2^4;
sbit OE=P2^5;
sbit START=P2^6;
sbit EOC=P2^7;
sbit P30=P3^0;
sbit select0=P3^7;
sbit select1=P3^6;
sbit select2=P3^5;
1