Dim New As Bit
Dim Command As Byte , Subaddress As Byte
Reset Tcon.0 'triggered by rising edge
On Int0 Receiverc5
Enable Int0
Enable Interrupts
Do
If New = 1 Then 'received new code
Disable Int0
' Print Command ; " " ; Subaddress
Print Command '; " " ; Subaddress
New = 0 'reset new bit
If Subaddress.5 = 1then
Print "toggle bit set"
End If
Subaddress = Subaddress And &B00011111
Enable Int0
End If
Loop
Receiverc5: 'interrupt routine
'the getrc5 routine uses 30 bytes ! of the stack for measuring
'the interval between the bits
Getrc5(subaddress , Command)
New = 1 'set flag
Return
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum