RC5 Code Bascom

Gast #1973890
Lesenswert?

Mein Code sieht bis jetzt so aus.Leider ist es bis jetzt ja nur möglich 
Relais1 zu schalten und das mit jedem RC5 Befehl der kommt.Ich möchte 
eine bestimmte Geräteadresse und Kommando bestimmen.

$regfile = "m8def.dat"
$crystal = 3686400

Config Portb.0 = Output
Config Portb.1 = Output
Config Portb.2 = Output

Config Rc5 = Pind.2

Enable Interrupts
Dim Address As Byte , Command As Byte

Relais1 Alias Portb.0
Relais2 Alias Portb.1
Relais3 Alias Portb.2

Do
Getrc5(address , Command)

If Address < 255 Then
Toggle Relais1

Command = Command And &B01111111

End If

Loop
End
Gast #1973927
Lesenswert?

Vielen dank!Ich hatte schon die ganze Zeit nach einer lib gesucht wo die 
Befehle drin stehen.Ich habe jetzt aber nochmal ein bißchen nachgedacht 
und folgende Lösung gefunden.

If adress=8 then
if command=87 then
toggle Relais1
if end
if end
else
if end

loop
end

Jetzt mache ich das noch mit Relais 2 und 3 und hoffe es geht.Ansonsten 
lese ich mal die Hilfe,kann nicht schaden.

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren