$regfile = "2313def.dat" $crystal = 4000000 Config Sda = Portd.5 Config Scl = Portd.4 Config I2cdelay = 100 Config Pind.6 = Output Const Lm76write = &H90 Const Lm76read = &H91 Dim Tempint As Integer At $80 Dim Tempbytelo As Byte At $80 Overlay Dim Tempbytehi As Byte At $81 Overlay Dim Templong As Long Cls Do Set Portd.6 I2cstart I2cwbyte Lm76write 'pointer set to temperature register I2cwbyte 0 I2cstart I2cwbyte Lm76read I2crbyte Tempbytehi , Ack I2crbyte Tempbytelo , Nack I2cstop Cls Lcd Tempbytehi ; " " ; Tempbytelo Lowerline Shift Tempint , Right , 3 Templong = Tempint * 625 Lcd Tempint ; " " ; Templong Reset Portd.0.6 Wait 1 Loop End