#include<reg51.h>
#define uchar unsigned char
#define uint unsigned int
sbit Motor1=P1^7;
sbit Motor2=P1^6;
sbit key1=P1^1;
sbit key2=P1^2;
sbit DQ=P1^0;
uchar temp_value; //温度值
uchar TempBuffer[5];
#include"DS18B20.h"
#include"LCD.h"
void main()
{ LCD_init();
LCD_str(0,0,"temperature");
while(1)
{ ReadTemp();
temp_to_str();
LCD_str(1,5,TempBuffer);
Motor1=1;
Motor2=0;
}
}
|