#include<reg52.h>
#include"lcd1602.h"
#include"ds18b20.h"
#include"ds18b20_2.h"
#include"ds18b20_3.h"
#include"ds18b20_4.h"
#define uchar unsigned char
#define uint unsigned int
#define tiMER0_COUNT 0xEE11
sbit SPK=P3^5;
sbit LED1=P3^6;
sbit LED2=P3^7;
bit flag;
uint wendu;
uint wendu1;
uint wendu2;
uint wendu3;
uchar count,timer0_tick,count=0;
static void timer0_initialize(void)
{
EA=0;
timer0_tick=0;
TR0=0;
TMOD=0X01;
TL0=(TIMER0_COUNT & 0X00FF);
TH0=(TIMER0_COUNT >> 8);
PT1=1;
ET0=1;
TR0=1;
EA=1;
}
void display_temp()
{
uchar A1,A2;
uchar A3,A4;
uchar A5,A6;
uchar A7,A8;
tmpchange();
wendu=tmp();
A1=wendu/10;
A2=wendu%10;
gotoxy(1,1);
display_data(A1);
display_string(".");
write_date(int_to_char[A2]);
tmpchange2();
wendu1=tmp2();
A3=wendu1/10;
A4=wendu1%10;
gotoxy(2,1);
display_data(A3);
display_string(".");
write_date(int_to_char[A4]);
tmpchange3();
wendu2=tmp3();
A5=wendu2/10;
A6=wendu2%10;
gotoxy(1,7);
display_data(A5);
display_string(".");
write_date(int_to_char[A6]);
tmpchange4();
wendu3=tmp4();
A7=wendu3/10;
A8=wendu3%10;
gotoxy(2,7);
display_data(A7);
display_string(".");
write_date(int_to_char[A8]);
}
void timer0(void) interrupt 1
{
TR0=0;
TL0=(TIMER0_COUNT & 0X00FF);//设置Timer0低八位数值
TH0=(TIMER0_COUNT >> 8);//设置Timer0高八位数值
TR0=1;
count++;
if(count==10) display_temp();
}
void main()
{
init_lcd();
timer0_initialize();
gotoxy(1,1);
display_string("00.0C");
gotoxy(2,1);
display_string("00.0C");
while(1)
{
if((wendu>500) || (wendu1>500) || (wendu2>500) || (wendu3>500))
{
SPK=~SPK;
LED1=~LED1;
delay(30);
}
else if ((wendu<100) || (wendu1<100) || (wendu2<100) || (wendu3<100))
{
SPK=~SPK;
delay(20);
LED2=~LED2;
}
错误是I:DPJ KEIL CWENDUJI.C(43): warning C206: 'gotoxy': missing function-prototype和I:DPJ KEIL CWENDUJI.C(43): error C267: 'gotoxy': requires ANSI-style prototype
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>