Startseite
  Archiv
  Gästebuch
  Kontakt
 


https://myblog.de/codebox

Gratis bloggen bei
myblog.de





$regfile = "m8def.dat"
$crystal = 4000000
$baud = 19200

Config 1wire = Portb.0

Const Ds1820 = &H10

Const Skiprom = &HCC
Const Read_rom = &H33
Const Convertt = &H44
Const Read_ram = &HBE
Const Write_ram = &H4E
Const Copy_ram = &H48
Const Recall_ee = &HB8
Const Read_power = &HB4

Dim Family_code As Byte
Dim Serial_number(6) As Byte
Dim Crc As Byte
Dim Scratch(9) As Byte

Dim I As Byte
Dim Temp As Word
Dim Temp1 As Integer
Dim Stemp As Single

Config Portd.7 = Output
Lcd_rw Alias Portd.7
Lcd_rw = 0

Config Lcdbus = 4



Do
  Cls
  Initlcd
   1wreset
   If Err = 1 Then
   Lcd "DS 1820 Error"

   1wwrite Read_rom

   Family_code = 1wread()
   For I = 1 To 6
       Serial_number(i) = 1wread()
   Next
   Crc = 1wread()
   If Family_code <> Ds1820 Then
   Exit Do

   1wwrite Convertt
    Do
    Temp = 1wread()
    Loop Until Temp = &HFF

     1wreset
     If Err = 1 Then
     Locate 1 , 1
     Lcd " DS 1820 Error"

      1wwrite Skiprom
      1wwrite Read_ram

      For I = 1 To 9
          Scratch(i) = 1wread()
          Next

          Temp = Scratch(2)
          Shift Temp , Left , 8

           Temp = Temp + Scratch(1)
           Temp1 = Temp
           Locate 1 , 1
           Lcd "Der Temp.wert ist" ; Temp ; "Counts."
           Temp1 = Temp1 / 2
           Locate 2 , 1
           Lcd "Die gemessen Temp.ist" ; Temp1 ; "Grad"
            Stemp = Scratch(8) - Scratch(7)
            Stemp = Stemp / Scratch(8)
            Stemp = Stemp + Temp1
            Stemp = Stemp - 0.25
             Locate 3 , 1
             Lcd "Und exakt";
             Lcd Fusing(stemp , "#.##";
             Locate 4 , 1
             Lcd "Grad Celsius"
             Wait 2
           Loop
           Locate 1 , 1
           Lcd "Kein Sensor aktiv"
           End If
           End If
           End
16.9.06 17:13
 


bisher 0 Kommentar(e)     TrackBack-URL

Name:
Email:
Website:
E-Mail bei weiteren Kommentaren
Informationen speichern (Cookie)


Die Datenschuterklärung und die AGB habe ich gelesen, verstanden und akzeptiere sie. (Pflicht Angabe)

 Smileys einfügen



Verantwortlich für die Inhalte ist der Autor. Dein kostenloses Blog bei myblog.de! Datenschutzerklärung
Werbung