Hallo Ich habe mir eine Uhr mit Bascom gebastelt. Alles funktioniert eigentlich. Aber der DS1307 muss auch irgendwann nachgestellt werden.
Da ich keine andere Möglichkeit habe würde ich das gerne mit einer RC5 Fernbedienung machen.

Leider schaffe ich es nicht und hoffe auf Eure Hilfe.

Ich stelle es mir so vor. Ich tippe die Zahlen der Reihe nach in die Fernbedienung und mit der OK Taste werden die Daten in den DS1307 übernommen. Über ein/aus möchte ich noch ein und ausschalten.

Code:
HTML-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 Zeit As Byte
'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
      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" ; Zeit = 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



Loop
End

Ich schaffe es nun, die Zahlen einzeln am Terminal auszugeben, habe aber keine Ahnung wie die Zahlen zusammengefasst werden. Zum Beispiel in 1230 für 12 Uhr 30

Ich bitte um Hilfe.

Gruß

Rici