Kod: Zaznacz cały
$regfile = "89c4051.dat"
$baud = 9600
$crystal = 11059200
Dim Kod As Bit
Dim Com As Byte , Suba As Byte
Dim Kat As Bit
Dim Lc As Bit
Kat = 1
Lc = 1
Reset P1.6
Reset P1.7
Set P1.2
Set P1.3
Set P1.4
Set P1.5
Set Tcon.0
On Int0 Receiverc5
Enable Int0
Enable Interrupts
Do
If Kod = 1 Then
Disable Int0
If Suba = 40 Then
If Com = 12 Then
Reset P1.2
Wait 2
Set P1.2
End If
If Com = 1 Then
Reset P1.3
Set P1.3
End If
End If
If Suba = 32 Then
If Com = 42 Then
Reset P1.4
Wait 2
Set P1.4
End If
If Com = 46 Then
Reset P1.5
Wait 2
Set P1.5
End If
If Com = 11 Then
If Kat = 0 Then
Reset P1.6
Kat = 1
Else
Set P1.6
Kat = 0
End If
End If
If Com = 62 Then
If Lc = 0 Then
Reset P1.7
Lc = 1
Else
Set P1.7
Lc = 0
End If
End If
End If
Kod = 0
Enable Int0
End If
Loop
Receiverc5:
Getrc5(suba , Com)
Kod = 1
Return