Advice please, got a HC-06 and HC-06, 1 slave & other is master but errors in comms!
Hi
I have a pair of blue tooth modules, HC-06. I purchased them from Ebay. I have managed to get them to link and I have been able to share data serially between the two devices. However in a simple program which increments a variable by 1 each loop and then sends the value to the other module wirelessly which is then uploaded to the PE terminal via a AXE027 cable using the command sertxd, there are random errors occurring in the transmission.
This means I have to introduce some s/ware verification of the transmitted data. I have written tWo very simple test programs where by the data is only output if two sets of data which are received in series are the same. (well, to a degree, ie the qualifiers? are correct)
Please can you recommend and explain other ways of doing this or send links to detailed explanations on how to devise simple s/ware error checking routines.
Many Thanks for looking....
TX PROGRAM
RX PROGRAM
This was my first uneducated attempt. It ensures to some degree that there is error checking. The next stage was to compare the two values of b1,b2,b3 from each set 8 & 9 and then if they didn't match I would disregard the data. However this potentially means data could be missed. Any help in s/ware driven error checking would be appreciated.
Hi
I have a pair of blue tooth modules, HC-06. I purchased them from Ebay. I have managed to get them to link and I have been able to share data serially between the two devices. However in a simple program which increments a variable by 1 each loop and then sends the value to the other module wirelessly which is then uploaded to the PE terminal via a AXE027 cable using the command sertxd, there are random errors occurring in the transmission.
This means I have to introduce some s/ware verification of the transmitted data. I have written tWo very simple test programs where by the data is only output if two sets of data which are received in series are the same. (well, to a degree, ie the qualifiers? are correct)
Please can you recommend and explain other ways of doing this or send links to detailed explanations on how to devise simple s/ware error checking routines.
Many Thanks for looking....
TX PROGRAM
Code:
#picaxe 08M2
setfreq m8
low C.1
pause 1000
main:
serout C.0, T9600_8, (#8, #b0)
pause 100
serout C.0, T9600_8, (#9, #b0)
PAUSE 100
b0 = b0 + 1
goto main
Code:
#picaxe 14M2
#terminal 9600
setfreq m8
main:
serin B.1, T9600_8, b0,b1,b2,b3
if b0="8" then
serin B.1, T9600_8, b0,b1,b2,b3
if b0="9" then
sertxd ( "value: ", b0,b1,b2,b3,cr,lf )
endif
endif
goto main