Shop OBEX P1 Docs P2 Docs Learn Events
912Mhz modules — Parallax Forums

912Mhz modules

bboy8012bboy8012 Posts: 153
edited 2007-11-26 04:13 in BASIC Stamp
I just received the 912Mhz modules and am using the instructions but am only getting·random letters from "Hello World"·that I am trying to send! Any help? Attached is my test code

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-11-26 02:02
    Your BS2 receive program is attempting to receive and display one character at a time. The BASIC Stamps are single-tasking, which means that all serial I/O is done in the foreground. While you're sending one character to DEBUG, the character (or two) after it is already coming in and being missed. The reason you're seeing garbage is that one of a subsequent character's data bits is being mistaken for a start bit, putting the serial receiver out of sync.

    It would be better to prepend your message with a unique string of characters, which you can wait for using the WAIT modifier in SERIN. Then input the requisite number of characters after that into a byte array using STR. Once all the characters have been read in, then you can output them to DEBUG.

    -Phil
  • bboy8012bboy8012 Posts: 153
    edited 2007-11-26 04:00
    Ok so I tried what you said, and I am not getting any funky characters, but am not still getting the whole statement. Heres the revised code. Any help are example? Thanks in advanced
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-11-26 04:13
    Read the manual for the DEBUG statement. There you will find that it, too, supports the STR modifier. As it stands, your receive program is asking DEBUG to print only the first character of the array.

    -Phil
Sign In or Register to comment.