We need a little more info. Essentially what you want to do is easy. If you have the RF modules, there is sample code that comes with it. Bottome line is you use the serout command, but there is a little more to it than that.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
reciever module.
e VAR Word
s VAR word
DO ·SERIN 0, 84, [noparse][[/noparse]WAIT("!"), e.HIGHBYTE,e.LOWBYTE· ]···· 'warning led on ·GOSUB ledwhite ·SERIN 0, 84, [noparse][[/noparse]WAIT("!"), s.HIGHBYTE,s.LOWBYTE ] ·GOSUB ledred
LOOP
ledred:
HIGH 5
RETURN
ledwhite:
HIGH 3
RETURN
but that not what i try to do, i try to use Ping sensor to detect the object when the Ping detect and send to other Bs2 by 912mhz ,the code i post above just work for single charater· ,it will confuse to reciever two or more charater.
Try the link here. The modules are really quite simple, and all that you need to do is to serout on one side, and serin on the other. Just make sure that the serin side doesn't have any time sensitive things to do.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
send module.
e··· VAR···· Word
s··· VAR· Word
distance VAR word
ledred:
·IF distance > 80 AND· distance < 120 THEN
· SEROUT 10, 84, [noparse][[/noparse] "!",s.HIGHBYTE, s.LOWBYTE]·
·RETURN
·ledwhite:
·IF distance > 10 AND distance < 80 THEN
· SEROUT 10, 84, [noparse][[/noparse] "!", e.HIGHBYTE, e.LOWBYTE]
· return
reciever module.
e VAR Word
s VAR word
DO
·SERIN 0, 84, [noparse][[/noparse]WAIT("!"), e.HIGHBYTE,e.LOWBYTE· ]···· 'warning led on
·GOSUB ledwhite
·SERIN 0, 84, [noparse][[/noparse]WAIT("!"), s.HIGHBYTE,s.LOWBYTE ]
·GOSUB ledred
LOOP
ledred:
HIGH 5
RETURN
ledwhite:
HIGH 3
RETURN
But did not work with this code.
Post Edited (Tomvn) : 1/3/2009 6:23:42 AM GMT
From what I see you have to use the CR command for you send a string see code routines bellow
I hope this helps
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
··Thanks for any·
·
·
·
·
Sam
but that not what i try to do, i try to use Ping sensor to detect the object when the Ping detect and send to other Bs2 by 912mhz ,the code i post above just work for single charater· ,it will confuse to reciever two or more charater.
Post Edited (Tomvn) : 1/3/2009 6:25:00 AM GMT