$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 Const Lm76resolution = 625 Dim Tempint As Word Dim Tempbytelo As Byte Dim Tempbytehi As Byte Dim Tempall As Long Dim Temprem As Long Dim Temptemp As Long Dim Tempdeg As Long Dim Tempsign As Byte Dim Tempdigit As Integer Do Cls Set Portd.6 I2cstart I2cwbyte Lm76read I2crbyte Tempbytehi , Ack I2crbyte Tempbytelo , Nack I2cstop Lcd Tempbytehi ; Tempbytelo ; " " Tempint = Makeint(tempbytelo , Tempbytehi) Tempsign = Tempbytehi And 128 If Tempsign = 128 Then Tempint = Not Tempint Tempint = Tempint + 1 End If Shift Tempint , Right , 3 Lcd Tempint ; " " Tempall = Tempint * Lm76resolution Lcd Tempall ; " " Tempdeg = Tempall / 10000 Temptemp = Tempdeg * 10000 Temprem = Tempall - Temptemp Lowerline Lcd Tempdeg ; " " ; Temprem ; " " Tempdigit = Temprem / 1000 Temptemp = Tempdigit * 1000 Temprem = Temprem - Temptemp If Temprem > 499 Then Tempdigit = Tempdigit + 1 If Tempdigit > 9 Then Tempdigit = 0 Tempdeg = Tempdeg + 1 End If If Tempsign = 128 Then Lcd "-" Lcd Tempdeg ; "." ; Tempdigit Loop End