DS18B20温度计 1602液晶显示温度
#include
#defineucharunsignedchar
#defineuintunsignedint
sbitDQ=P3^7;//ds18b20与单片机连接口
sbitRS=P3^0;
sbitRW=P3^1;
sbitEN=P3^2;
unsignedcharcodestr1[]={"temperature:"};
unsignedcharcodestr2[]={""};
uchardatadisdata[5];
uinttvalue;//温度值
uchartflag;//温度正负标志
用户评论