-
-
Erfahrener Benutzer
Begeisterter Techniker
Hi!
Recht umfangreich sind Deine Codes.....
Also ich habe nur folgendes drin und es funst:
Config Dcf77 = Pinb.0 , Timer = 1 , Inverted = 1 , Timer1sec = 1 , Update = 1 , Updatetime = 1 , Check = 1 , Debug = 1 , 'Switchpower = 1 , Powerlevel = 1 , Powerpin = Pina.2
Enable Interrupts
Config Date = Dmy , Separator = . 'deutsches Datumsformat
'CONFIG CLOCK = SOFT .
Dim I As Integer
Dim Sec_old As Byte , Dcfsec_old As Byte
'Dim Dcf77_signal As Word 'String * 20
Sec_old = 99 : Dcfsec_old = 99 ': DCF_Debug_Timer
= 0
For I = 1 To 78
Waitms 10
If Sec_old <> _sec Then
Exit For
End If
If Dcfsec_old <> Dcf_sec Then
Exit For
End If
Next
Waitms 220
Sec_old = _sec
Dcfsec_old = Dcf_sec
Locate 1 , 1
Lcd Time$ ; " " ; Lookupstr(_weekday , Wochentag) ; " " ; Date$ ; " "
Für die DCF Zeit, und für den Sensor:
Config 1wire = Porta.0
Dim T As Byte
Dim Id1( As Byte
Dim Id2( As Byte
Dim Ar1(2) As Byte
Dim Ar2(2) As Byte
Dim Ar(2) As Byte
Dim Temperatur1 As Integer
'Dim Temperatur2 As Integer
Dim Halb As Byte
Id1(1) = 1wsearchfirst()
'Id2(1) = 1wsearchnext()
1wreset 'reset
1wwrite &H55 'Match Rom command
1wwrite Id1(1) , 8 'Id von Sensor 1
1wwrite &H44 'Convert T
Waitms 150 '300 'warten bis convert T fertig ist
1wreset 'reset
1wwrite &H55 'match rom command
1wwrite Id1(1) , 8 'id von sensor 1
1wwrite &HBE
For T = 1 To 2
Ar(i) = 1wread(1)
Next
Deflcdchar 0 , 4 , 10 , 10 , 4 , 32 , 32 , 32 , 32 ' replace ? with number (0)
Deflcdchar 1 , 15 , 9 , 9 , 15 , 9 , 15 , 8 , 8 ' replace ? with number (1)
Locate 3 , 1
Temperatur1 = Ar(1)
If Ar(2) > 0 Then Temperatur1 = 0 Else Shift Temperatur1 , Right
Lcd "Au" ; Chr(1) ; "entempra " ; Temperatur1 ; ".";
Halb = Ar(1) And 1
If Halb = 1 Then Lcd "5" Else Lcd "0"
Locate 3 , 18
Lcd ; Chr(0)
Locate 3 , 19
Lcd "C"
Hast Du eventuell nen Code für den DS1820 mit negativer Temp-Anzeige?
Berechtigungen
- Neue Themen erstellen: Nein
- Themen beantworten: Nein
- Anhänge hochladen: Nein
- Beiträge bearbeiten: Nein
-
Foren-Regeln
Lesezeichen