..transmitted via wireless reliably....!
Hi all
I have been playing around with things like serin/out, debug serin2/out2 and hserin/out.
I am using hserout for this example with a TX and RX module from Rentron which work very well.
I have two tiny problems at this stage though.
1.I need to be able to on the press of the transmit button send 4
2. The receiver must do some sort of check on what it has received.
Now as I understand it this could be in the form of manchester coding on both sides, bit-wise compliment send and check,the use of endocder/decoder pairs (or code) and or a CRC or checksum.
So I scoured the forums looking for something really simple to experiment with initially and came up with the code below.It's bulky and won't expand easily and what's more is I haven't tested it yet .. TIME... SIGH!
I would just like some advice as to where or not I am on the right track (will the code even work ?) and possibly some extra options or thoughts, perhaps some simple maths on both sides ?
I would lolve to hear your thoughts and experiences and possibly a little help
Kind regards
Dennis
See my code below (4 bytes of which 3 will be constants)
Code:TX side ------- hserout [TRAIN,TRAIN,TRAIN,TRAIN,TRAIN,TRAIN,synch,hcode,dcode,pcode,hcode,dcode,pcode,data,data,data,data,data,data] 'where hdcode,dcode and pcode are constant hcode con 31 dcode con 32 pcode con 11 'data is either 0 or 1 data var byte RX side ------- hcode con 31 dcode con 32 pcode con 11 address1 var byte address2 var byte address3 var byte address4 var byte address5 var byte address6 var byte data1 data2 data3 data4 data5 data6 hserin[WAIT(SYNK),address1, address2,address3,address4,address5,address6,data1,data2,data3,data4,data5,data6] IF ((address1 == hcode) && (address3 == hcode)) && ((address2 == pcode) &&(address4 == pcode)) && ((address2 == dcode) &&(address4 == dcode))then portb.0=1 'becuase all 3 address bits match else portb.1=0 endif if ((data1 == data3) && (data2 == data4) && (data5 == data6)) then 'check on MATCH variable! 'or I could use this 'if data1 == data2 == data3 == data4 == data5 == data6 then let data 1 = match let match = portb




Bookmarks