void temp_convert(void)
{
negetiveflag=0;
negetiveflag=temp_h&0x80;
if(negetiveflag)
{
negetiveflag=1;
temp_h=~temp_h;
if(temp_l==0)
{
temp_h++;
}
temp_l=~temp_l+1;
}
temp_h<<=4;
temp_l>>=4;
temp_over=temp_h|temp_l;
tempalarm=temp_over;
if(negetiveflag==1)
{
tempalarm=tempalarm*(-1);
}
}
ds18b20温度转换这段程序谁能详细说明一下怎么运行的,如果我想计算小数如何改动