毕业设计指导网:毕业设计范文、毕业答辩指导,免费毕业设计、计算机毕业论文参考资料下载服务。

技术团队主要成员为国内著名高校计算机专业导师。诚实守信,优质服务,是我们的宗旨!
当前位置:毕业设计指导网毕业论文频道计算机毕业论文

单片机数字温度测试程序

论文出自毕业设计指导网www.bysj120.cn,需要购买整套毕业论文或找不到您要的毕业设计请联系客服索取

用一片DS18B20构成测温系统,测量的温度精度达到0.1度,测量的温度的范围在-20度到+100度之间,用8位数码管显示出来。
 
#include <AT89X52.H>
 
#include <INTRINS.h>
 
 
 
unsigned char code displaybit[]={0xfe,0xfd,0xfb,0xf7,
 
                                 0xef,0xdf,0xbf,0x7f};
 
unsigned char code displaycode[]={0x3f,0x06,0x5b,0x4f,
 
                                    0x66,0x6d,0x7d,0x07,
 
                                    0x7f,0x6f,0x77,0x7c,
 
                                    0x39,0x5e,0x79,0x71,0x00,0x40};
 
unsigned char code dotcode[32]={0,3,6,9,12,16,19,22,
 
                                25,28,31,34,38,41,44,48,
 
                                50,53,56,59,63,66,69,72,
 
                                75,78,81,84,88,91,94,97};
 
unsigned char displaycount;
 
unsigned char displaybuf[8]={16,16,16,16,16,16,16,16};
 
unsigned char timecount;
 
unsigned char readdata[8];
 
 
 
sbit DQ=P3^7;
 
bit sflag;
 
 
 
 
 
bit resetpulse(void)
 
{
 
  unsigned char i;
 
 
 
  DQ=0;
 
  for(i=255;i>0;i--);
 
  DQ=1;
 
  for(i=60;i>0;i--);
 
  return(DQ);
 
  for(i=200;i>0;i--);
 
}
 
 
 
void writecommandtods18b20(unsigned char command)
 
{
 
  unsigned char i;
 
  unsigned char j;
 
 
  for(i=0;i<8;i++)
 
    {
 
      if((command & 0x01)==0)
 
        {
 
          DQ=0;
 
          for(j=35;j>0;j--);
 
          DQ=1;
 
        }
 
        else
 
          {
 
            DQ=0;
 
            for(j=2;j>0;j--);
 
            DQ=1;
 
            for(j=33;j>0;j--);
 
          }
 
      command=_cror_(command,1);     
 
    }
 
}
 
 
 
unsigned char readdatafromds18b20(void)
 
{
 
  unsigned char i;
 
  unsigned char j;
 
  unsigned char temp;
 
 
 
  temp=0;
 
  for(i=0;i<8;i++)
 
    {
 
      temp=_cror_(temp,1);计算机毕业设计网,需要全部完整程序请联系客服
 

Tags:

在线客服

  • 咨询QQ:
  • 407894958
  • 点击和客服QQ在线沟通
  • 点击和客服QQ在线沟通
  • 成品购买:
  • 定制咨询:
  • 点击和客服QQ在线沟通
  • 点击和客服QQ在线沟通
  • 如临时会话消息无法接收 请先加客服QQ好友咨询
    微信客服

计算机毕业设计,免费毕业论文,优秀毕业设计论文下载


120毕业设计指导网
地址:徐州市西安路41号
收缩
  • 计算机毕业设计定做咨询