#include <REGX51.H>
#include "LCD1602.h"
#include "DS18B20.h"
void init(void)
{
num=0;
al
ARM_flag=0;
alarm_num=0;
temp_max=36; //设置温度上限值
temp_min=0; //设置温度下限值
TMOD=0x01; //定时器T0工作于方式1
TH0=(65536-50000)/256; //定时器T0赋初值
TL0=(65536-50000)%256;
EA=1; //开总允许中断
ET0=1; //开定时器T0中断
TR0=1; //启动定时器T0
}
/******1us的延时(12M)延时子程序*******/
void delay_us(uchar x) //when crystal is 12M ,a*2+5 us ,
{ // 子程序调用要5us,while 就等于DJNZ指令
while (--x); //x取值1~255;
}
/******1ms的延时(12M)延时子程序*******/
void delay_ms(uchar x)
{
uchar i,j;
for (i=0; i<x; i++)
for (j=0; j<200; j++)
{
_nop_(); //一个nop约1us
_nop_();
}
}
/*********dds18b20初始化*******/
..
........ est2.c(3): warning C318: can't open file 'DS18B20.h'
..........TEST2.C(6): error C202: 'num': undefined identifier
..........TEST2.C(7): error C202: 'alarm_flag': undefined identifier
..........TEST2.C(8): error C202: 'alarm_num': undefined identifier
..........TEST2.C(9): error C202: 'temp_max': undefined identifier
..........TEST2.C(10): error C202: 'temp_min': undefined identifier
..........TEST2.C(19): error C141: syntax error near 'x', expected ')'
..........TEST2.C(21): error C202: 'x': undefined identifier
..........TEST2.C(24): error C141: syntax error near 'x', expected ')'
..........TEST2.C(26): error C141: syntax error near 'i'
..........TEST2.C(26): error C202: 'i': undefined identifier
..........TEST2.C(27): error C202: 'i': undefined identifier
..........TEST2.C(28): error C202: 'j': undefined identifier
..........TEST2.C(37): error C202: 'DQ': undefined identifier
..........TEST2.C(39): error C202: 'DQ': undefined identifier
..........TEST2.C(42): error C202: 'DQ': undefined identifier
..........TEST2.C(45): error C141: syntax error near 'while'
..........TEST2.C(45): error C202: 'DQ': undefined identifier
..........TEST2.C(50): error C202: 'DQ': undefined identifier
..........TEST2.C(53): error C141: syntax error near 'a', expected ')'
..........TEST2.C(55): error C141: syntax error near 'i'
..........TEST2.C(55): error C202: 'i': undefined identifier
..........TEST2.C(56): error C202: 'i': undefined identifier
..........TEST2.C(58): error C202: 'a': undefined identifier
..........TEST2.C(60): error C202: 'DQ': undefined identifier
..........TEST2.C(64): error C202: 'DQ': undefined identifier
..........TEST2.C(67): error C202: 'DQ': undefined identifier
..........TEST2.C(72): error C202: 'DQ': undefined identifier
..........TEST2.C(74): error C202: 'a': undefined identifier
..........TEST2.C(77): error C129: missing ';' before 'read1820'
一周热门 更多>