ich hab z.Zt. folgenden Code:
Code:
$regfile = "m128def.dat"
$crystal = 16000000
Config Timer1 = Timer , Prescale = 256
Enable Timer1
On Timer1 Tini
Enable Interrupts
Timer1 = 68569
Dim Tresult As String * 8
Dim Dresult As String * 8
Dim D1 As String * 2
Dim D2 As String * 2
Dim D3 As String * 2
Dim Year As Word
Dim Month As Word
Dim Day As Word
Dim Hour As Word
Dim Minute As Word
Dim Second As Word
minute = 58
Do
'....Hauptprogramm
Loop
End
Tini:
Timer1 = 68569
Second = Second + 1
If Second = 60 Then Gosub Addminute
If Minute = 60 Then Gosub Addhour
If Hour = 24 Then Gosub Addday
If Day = 30 Then Gosub Addmonth
If Month = 12 Then Gosub Addyear
D1 = Format(hex(second) , "00")
D2 = Format(hex(minute) , "00")
D3 = Format(hex(hour) , "00")
Tresult = Hour + ":" + Minute + ":" + Second
Print Tresult
Return
Addminute:
Minute = Minute + 1
Second = 0
Return
Addhour:
Hour = Hour + 1
Minute = 0
Return
Addday:
Day = Day + 1
Hour = 0
Return
Addmonth:
Month = Month + 1
Day = 0
Return
Addyear:
Year = Year + 1
Month = 0
Return
Mfg
Tobi
Lesezeichen