sbit LCD_RS at LATD2_bit; sbit LCD_EN at LATD3_bit; sbit LCD_D4 at LATD4_bit; sbit LCD_D5 at LATD5_bit; sbit LCD_D6 at LATD6_bit; sbit LCD_D7 at LATD7_bit; sbit LCD_RS_Direction at TRISD2_bit; sbit LCD_EN_Direction at TRISD3_bit; sbit LCD_D4_Direction at TRISD4_bit; sbit LCD_D5_Direction at TRISD5_bit; sbit LCD_D6_Direction at TRISD6_bit; sbit LCD_D7_Direction at TRISD7_bit; char data1[9]; float temp; void main() { char s[16]; AD1PCFG = 0xFFFF; Lcd_Init(); Lcd_Cmd(_LCD_CURSOR_OFF); Lcd_Out(1, 1, "Temperatura:"); Lcd_Chr(2,10,223); Lcd_Chr(2,11,'C'); do { Ow_Reset(&PORTD,11); Ow_Write(&PORTD,11, 0xCC ); Ow_Write(&PORTD,11, 0x44 ); Delay_us(120); Ow_Reset(&PORTD,11); Ow_Write(&PORTD,11, 0xCC ); Ow_Write(&PORTD,11, 0xBE ); Delay_ms(400); data1[0] = Ow_Read(&PORTD,11); data1[1] = Ow_Read(&PORTD,11); temp = 0.5*((data1[1]<<8)|data1[0]); FloatToStr(temp,s); //sprintf(s, "%2.2f", temp); Lcd_Out(2,1," "); Lcd_Out(2,1,s); Delay_ms(500); } while (1); }