Hi,
ich möchte die Uhrzeit für den RTC per Fernbedienung eingeben.
Leider habe komme ich da mit dem Code nicht weiter da immer eine Fehlermeldung kommt.
Könnt Ihr mir bitte helfen?
Mit freundlichen Grüßen
Schmidt R.
ich möchte die Uhrzeit für den RTC per Fernbedienung eingeben.
Leider habe komme ich da mit dem Code nicht weiter da immer eine Fehlermeldung kommt.
Könnt Ihr mir bitte helfen?
Code:
$regfile = "m16def.dat" 'ATmega 16
$crystal = 8000000 'Quarz: 8 MHz
$baud = 9600
$lib "mcsbyte.lbx" ' for smaller code
$lib "ds1307clock.lib" ' lib
Config Rc5 = Pind.2
Dim Ein_aus As Bit
'Dim Time$ As String * 8
Time$ = "17:37:00"
Enable Interrupts
Dim Address As Byte , Command As Byte
Print "Waiting for RC5..."
Do
Getrc5(address , Command)
If Address = 0 Then
Command = Command And &B01111111
' Print Address ; " " ; Command
If Command = 32 Then
If Ein_aus = 1 Then
Ein_aus = 0
Else
Ein_aus = 1
End If
End If
Waitms 500
Print "Status " ; Ein_aus
End If
Select Case Command
Case 16 : Print "0"
Case 17 : Print "1"
Case 18 : Print "2"
Case 19 : Print "3"
Case 20 : Print "4"
Case 21 : Print "5"
Case 22 : Print "6"
Case 23 : Print "7"
Case 24 : Print "8"
Case 25 : Print "9"
Case 40 : Print "ok"
Case 19 : Print "3"
Case 20 : Print "4"
Case 21 : Print "5"
Case 22 : Print "6"
Case 23 : Print "7"
' Case Else : Print "Not in Case statement"
End Select
Time$ = Command
Print Time$
Loop
End
Schmidt R.