求大神看看这个程序什么错误!在线等!!!!

2019-07-18 10:48发布

#include <REGX51.H>
#include "LCD1602.h"
#include "DS18B20.h"
void init(void)
{
num=0;
alARM_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'
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
4条回答
那低头一笑的温
1楼-- · 2019-07-18 12:54
头文件"DS18B20.h"打不开
那低头一笑的温
2楼-- · 2019-07-18 17:03
你检查一下是文件名打错,还是没有把该头文件加入工程
tangsic
3楼-- · 2019-07-18 18:05
你检查一下是文件名打错,还是没有把该头文件加入工程
dmdz2015
4楼-- · 2019-07-18 20:54
 精彩回答 2  元偷偷看……

一周热门 更多>