$regfile = "m8def.dat"
$crystal = 16000000
$baud = 115200

 Print "lofasz"

Config 1wire = Portb.5
Const Read_rom = &H33                                       ' DS1820 Commands
Const Skip_rom = &HCC
Const Convertt = &H44
Const Read_ram = &HBE
Const Write_ram = &H4E
Const Copy_ram = &H48
Const Recall_ee = &HB8
Const Read_power = &HB4
Dim I As Byte                                               ' Index
Dim Crc As Byte                                             ' DS1820 CRC
Dim Serial_number(6) As Byte
Dim Family_code As Byte                                     ' DS1820 Family Code = &H10


1wreset                                                     ' 1wire Reset
If Err = 1 Then                                             ' On Error blink fast
    Print "bug1"
End If
1wwrite Read_rom                                            ' Read ROM command
Family_code = 1wread()                                      ' Read 8 Bytes ROM contents
For I = 1 To 6
    Serial_number(i) = 1wread()
Next
Crc = 1wread()
1wreset                                                     ' 1wire Reset
If Err = 1 Then                                             ' On Error blink fast
    Print "bug2"
End If
' Display Family Code
Do

Print "fa.co. : " ; Hex(family_code)
' Display 6-Byte Serial Number
Print "SN:"
For I = 1 To 6
    Print Hex(serial_number(i));
Next
Print "CRC:" ; Hex(crc)                                     ' Display CRC
Wait 3
Loop

End

