Shop OBEX P1 Docs P2 Docs Learn Events
how to send and reciever two variable or more with two rf 912mhz ? — Parallax Forums

how to send and reciever two variable or more with two rf 912mhz ?

TomvnTomvn Posts: 103
edited 2009-01-05 03:25 in BASIC Stamp
can anyone help?

Comments

  • JonathanJonathan Posts: 1,023
    edited 2009-01-02 18:31
    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
  • TomvnTomvn Posts: 103
    edited 2009-01-03 04:05
    here my code , this i want send more than one variable charater to another bs2 by 912mhz module, i have two 912mhz module

    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
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2009-01-03 05:17
    Here try this code and see if you get them to work

    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·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam
  • TomvnTomvn Posts: 103
    edited 2009-01-03 06:17
    Thanks for help,,

    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
  • TomvnTomvn Posts: 103
    edited 2009-01-04 07:02
    can anyone help?
  • SRLMSRLM Posts: 5,045
    edited 2009-01-05 03:25
    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.
Sign In or Register to comment.