Using Beau Schwabe's 433 MHz RF Transceiver Object
SEL
Posts: 80
I am trying to transmit and receive in the same method, but I am not able to if I RF.Send or RF.Receive first one or the other methods will not work for me. Here is my code. I hope someone can help me with this problem.
VAR
byte Receive_Buffer[1]
PUB TX_Main
RF.Initialize(PacketLength)
dira[LED_PIN]~~
outa[LED_PIN] := 1
Receive_Buffer[0] := 65
Receive_Buffer[1] := 66
Receive_Buffer := 0
repeat
RF.PutTXString(String("Hello World"))
RF.Send
waitcnt(clkfreq + cnt)
RF.Receive
RF.GetRXString(@Receive_Buffer)
if Receive_Buffer > 0
quit
outa[LED_PIN] := 0
repeat
VAR
byte Receive_Buffer[1]
PUB TX_Main
RF.Initialize(PacketLength)
dira[LED_PIN]~~
outa[LED_PIN] := 1
Receive_Buffer[0] := 65
Receive_Buffer[1] := 66
Receive_Buffer := 0
repeat
RF.PutTXString(String("Hello World"))
RF.Send
waitcnt(clkfreq + cnt)
RF.Receive
RF.GetRXString(@Receive_Buffer)
if Receive_Buffer > 0
quit
outa[LED_PIN] := 0
repeat
Comments
anyone who wishes to receive the code for both Tx and Rx email me at: slindojr@msn.com and I will set the zipped files to them.