while(1){
LCD_LINE(2);
LCD_STR((unsigned rom char*)"Temp: ");
temp = 0;
temp=ReadLM75BD(); //get temperature
if(temp<0){ //if negative
LCD_DATA('-',1); //put minus sign
temp=-temp; //and negate temperature
} else { //else
LCD_DATA(' ',1); //put a space
}
temp = 1.8*temp+32;
tH = ((temp/2) / 100) + 0x30;
tT = (((temp/2) % 100) / 10) + 0x30;
tO = ((temp/2) % 10) + 0x30;
LCD_DATA(tH,1);
LCD_DATA(tT,1);
LCD_DATA(tO,1);
LCD_DATA('.',1); //put decimal point
if(temp&1) //if there was a half degree
LCD_DATA('5',1); //display it
else
LCD_DATA('0',1); //or dont
LCD_DATA('F',1); //or dont
DelayMS(250);
DelayMS(250);
DelayMS(250);
DelayMS(250);
}