Shop OBEX P1 Docs P2 Docs Learn Events
RF Transmitter/Receiver (#27980) — Parallax Forums

RF Transmitter/Receiver (#27980)

James2010NGJames2010NG Posts: 10
edited 2010-07-01 14:56 in Accessories
Hi, I was wondering if anyone could help me out quickly. I am using the Basic Stamp 2 with the RF Transmitter/Receiver. Is there anyway that I can send a signal/code to the transmitter that makes it send out a certain signal to be picked up by the receiver. We only have 1 set of transmitter/receiver so we cannot send a signal to one transmitter to receiver to transmitter...
Thanks for any help!

Comments

  • FranklinFranklin Posts: 4,747
    edited 2010-07-01 01:59
    The transmitter is designed to transmit so that should work but what are you using to receive? What is it you need exactly and have you looked at the parallax site for sample code?
    ' TxCode_v_1.0.bs2
    '{$STAMP BS2}
    '{$PBASIC 2.5}
    '
    'Parallax 433.92 MHz RF Receiver (#27981) Sample Tx Code (BS2)
    'Connect Pin 8 of the BS2 to the DATA line on the RF module
    'Connect +5v to the 5v line, connect Ground to the GND line
    'This code will transmit two word sized counters, byte at a time.
    '
    'Note the PULSOUT instruction: this helps the receiver sync with
    'the transmitter, especially after lapses in communication
    'This code transmits at 9600 baud, inverted.
    x VAR Word
    y VAR Word
    DO
    PULSOUT 8, 1200 'Sync pulse for the receiver
    SEROUT 8, 16468, [noparse][[/noparse] "!", x.HIGHBYTE, x.LOWBYTE, y.HIGHBYTE, y.LOWBYTE ]
    x = x + 1
    y = y + 1
    PAUSE 10
    LOOP
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen

    Post Edited (Franklin) : 7/1/2010 2:04:05 AM GMT
  • James2010NGJames2010NG Posts: 10
    edited 2010-07-01 12:57
    We already used that code. We want to use the DEBUG terminal to try and send a signal to the RF transmitter to send a certain code to the receiver? Is this possible? You can change the transmitter code to send certain letters or numbers as the signals. So can I (for instance), enter a 0 into the transmitter DEBUG terminal and get a certain code (using IF...THEN)? Possibly with the DEBUGIN command?
  • Mike GreenMike Green Posts: 23,101
    edited 2010-07-01 14:56
    The DEBUG and DEBUGIN statements are really special cases of the SEROUT and SERIN statements with the pin number parameter equal to 16 and some simplification of the other parameters. The Parallax example you showed simply illustrates the transmission of two 16-bit binary numbers. You can send anything you want.

    Keep in mind that there may be a lot of radio noise present and there may be errors in the information received. It's good practice to use some kind of error detection. There are some examples with links on the product webpage on the use of CRC (cyclic redundancy checks) with the transmitter/receiver. The use of "!" or similar lead-in character also helps. In simple cases, you could just send the same data two or three times with different lead-in characters to get the redundancy.
Sign In or Register to comment.