The transmitter being used is the TLP-434 and the receiver used is the RLP-434
A link to the data sheet is:
http://www.sparkfun.com/datasheets/RF/TLPRLP.pdf
Code:
B2 VAR PORTB.0:Serin 0,N2400,B2:RX1 VAR PORTB.0:RX2 VAR PORTB.1:RX3 VAR PORTB.2:RX4 VAR PORTB.3:action VAR PORTB.4:alert VAR PORTB.5:PORTB.0=1:PORTB.1=0:PORTB.2=0:PORTB.3=1
B0 VAR PORTB.6:B1 VAR PORTB.7:PORTB.6=1:PORTB.7=0:B0=1:B1=0
'Tracking
If (RX3==0) && (RX4==0) Then 'Check if only tracking mode
If (RX1==B0) && (RX2==B1) Then 'Check if the address matches
RX3=1:action = RX3:High 0:alert = 0:Low 1
Else 'back to transmitter
action = RX3:Low 0:alert = 0:Low 1
Endif 'back tor transmitter
Endif
'Track and Find
If (RX3==0) && (RX4==1) Then
If (RX1==B0) && (RX2==B1) Then 'The receiver will take action to find the child
RX3=1:action=RX3:High 0:alert=1:High 1
Else
action=0:Low 0:alert=0:Low 1
Endif
Endif
Bookmarks