Just thought this might be helpful for those trying out using serial and RF links with Picaxe chips. Here are a couple of very short and simple code snippets that are the basis for me successfully sending Word variable information using simple serial RF links such as readily available and cheap TX/RF module pairs. A Picaxe-08M was used with this code.
Sending information via RF Link:
This snippet is the basic serout command with "wakeup string" (85,85,85,85) and identifier ("ABCDEF") and the word variable w0 broken down to it's constituent b0 and b1. Notice that b0 is sent BEFORE b1 for proper operation.
Main:
readadc10 4, w0
serout 2, N2400, (85,85,85,85,"ABCDEF",b0,b1)
pause 200
goto Main
End
Receiving information via RF link:
This is the corresponding receiver snippet. Again, using a Picaxe-08M.
Main:
serin 1,N2400,("ABCDEF"),b0,b1
sertxd(#w0," , ")
pause 200
goto Main
End
I hope this information helps.
Sending information via RF Link:
This snippet is the basic serout command with "wakeup string" (85,85,85,85) and identifier ("ABCDEF") and the word variable w0 broken down to it's constituent b0 and b1. Notice that b0 is sent BEFORE b1 for proper operation.
Main:
readadc10 4, w0
serout 2, N2400, (85,85,85,85,"ABCDEF",b0,b1)
pause 200
goto Main
End
Receiving information via RF link:
This is the corresponding receiver snippet. Again, using a Picaxe-08M.
Main:
serin 1,N2400,("ABCDEF"),b0,b1
sertxd(#w0," , ")
pause 200
goto Main
End
I hope this information helps.