Das müsste fast passen:
Code:'********************************************************** 'Compiler : Bascom ' : DS1820 'Chip type : AT90S8535 'Clock frequency : 8,000000 MHz '********************************************************** $include "ac_lcd.inc" Config 1wire = Portd.4 'use this pin Dim Ar(2) As Byte, A As Byte, I As Byte, Temperatur As Integer Dim Halb As Byte Lcd "Temp:" Do Wait 1 1 wreset 'reset the device 1 wwrite &HCC 'read ROM command 1 wwrite &H44 Waitms 100 'read ROM command 1 wreset 'reset the device 1 wwrite &HCC 'read ROM command 1 wwrite &HBE 'read ROM command For I = 1 To 2 Ar(i) = 1wread() 'place into array Next Locate 2, 1 Temperatur = Ar(1) If Ar(2) > 0 Then Temperatur = 0 Else Shift Temperatur, Right Lcd Temperatur ; "."; Halb = Ar(1) And 1 If Halb = 1 Then Lcd "5" Else Lcd "0" Lcd " C" Loop End







Zitieren

Lesezeichen