Transmitter to Receiver to PC
nico
Posts: 28
Hi,
I have a 27981 RF receiver and 27980 RF receiver. I'm able to transmit data to the receiver using bs2 with the following codes.
Transmitter
Receiver
Everything works fine using the above codes. However, when I'm going to send the data from the receiver to my PC using the SEROUT command, the readings are wrong.
Below is the edited receiver codes to send data to my pc. The debug window will show the correct readings using the above codes(cmDistance=006, cmDistance2=050). But, when using the below code to send data to my pc, the debug window will show the wrong readings(cmDistance=007058, cmDistance2=053007053)
I have a 27981 RF receiver and 27980 RF receiver. I'm able to transmit data to the receiver using bs2 with the following codes.
Transmitter
Main : CmConstant CON 2260 CmConstant2 CON 2260 cmDistance VAR Word cmDistance2 VAR Word time VAR Word time2 VAR Word DO PULSOUT 15, 5 PULSIN 15, 1, time PULSOUT 14, 5 PULSIN 14, 1, time2 cmDistance = cmConstant ** time cmDistance2 = cmConstant2 ** time2 DEBUG HOME, DEC3 cmDistance, CR DEBUG DEC3 cmDistance2 PULSOUT 8, 1200 SEROUT 8,16468,[noparse][[/noparse]"!", DEC3 cmDistance, DEC3 cmDistance2] PAUSE 100 LOOP
Receiver
cmDistance VAR Word cmDistance2 VAR Word DO SERIN 7, 16468, [noparse][[/noparse]WAIT("!"),DEC3 cmDistance,DEC3 cmDistance2] DEBUG HOME, DEC3 cmDistance, CR DEBUG DEC3 cmDistance2 LOOP
Everything works fine using the above codes. However, when I'm going to send the data from the receiver to my PC using the SEROUT command, the readings are wrong.
Below is the edited receiver codes to send data to my pc. The debug window will show the correct readings using the above codes(cmDistance=006, cmDistance2=050). But, when using the below code to send data to my pc, the debug window will show the wrong readings(cmDistance=007058, cmDistance2=053007053)
cmDistance VAR Word cmDistance2 VAR Word DO SERIN 7, 16468, [noparse][[/noparse]WAIT("!"),DEC3 cmDistance,DEC3 cmDistance2] SEROUT 16,16468,[noparse][[/noparse]DEC3 cmDistance,DEC3 cmDistance2] SEROUT 16,16468,[noparse][[/noparse]LF] DEBUG HOME, DEC3 cmDistance, CR DEBUG DEC3 cmDistance2 LOOP
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't worry. Be happy
you mean if i remove away the debug statement, the readings will be fine ?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't worry. Be happy
thx for the help. i did try removing the debug previously but it still can't work because it's the pc that is having problem. now it's solved. thanks very much.