Shop OBEX P1 Docs P2 Docs Learn Events
RF link to transmit variable value — Parallax Forums

RF link to transmit variable value

PLTW_EDD_StudentPLTW_EDD_Student Posts: 2
edited 2009-05-21 01:06 in Learn with BlocklyProp
Hello,

I have two Basic Stamp Homework Boards (can get BOE if needed) and a 433 MHz transmitter and receiver.

I need to make a program that will read a pushbutton switch (1, 2, or 3) on the sending board, and use it to set the value of a variable on the receiving board.

The receiving board is controlling a servo. The three buttons will each toggle a different action from the servo.

I can make a program that runs the different actions based on the state of a variable, using simple if...then statements. I can also make the program that sets the variable value from the pushbutton on the transmitting board. But I'm having a bit of trouble deciphering the example programs for the Transmitter/Receiver and applying them to what I need.

Can anyone give me some help or advice? Thanks in advance.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-05-20 01:52
    The example programs for the Transmitter / Receiver are important. You need to try them out and understand them. One Stamp is just sending serial information to the other. The transmitter has to be "primed" by making the control signal a low for a short time since a low turns the transmitter on while a high turns it off. The Stamp receiver end is not buffered, so it has to be listening when the 1st Stamp is sending information. You will also need some redundancy or error checking since there's no checking on the part of the Transmitter / Receiver or on the part of the receiving Stamp. The best way to get some redundancy is to send the information several times (like 10 or 20) and to include a sequence number. Every time the state of the buttons/switches changes, the transmitting Stamp increments a counter that gets sent with the status of the buttons/switches. The receiving Stamp accepts two copies of the received message. If they're not the same, it discards the first copy. If they're the same, it compares the counter value with the last counter value it accepted. If it's the same, it discards the oldest copy. If it's different, it saves the new value (accepts it) and acts on it (does the servo action).
  • Jessica UelmenJessica Uelmen Posts: 490
    edited 2009-05-20 16:49
    Hello,

    For a quick "how-to" on RF communication, check out the Wireless Musical Keyboard Mini-Project. It shows you how to play different tones on a piezospeaker using 3 pushbuttons. You will definitely need to use the techniques Mike mentioned for your project, but this should help get you off and running.

    Happy Developing!

    Jessica

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jessica Uelmen
    Education Department
    Parallax, Inc.
  • PLTW_EDD_StudentPLTW_EDD_Student Posts: 2
    edited 2009-05-21 01:06
    Thanks! That is extremely helpful. I think I'm starting to get how the transmission works.

    The music program is very similar to what I want to do...instead of the freqout I can just sub in my pulsout statement.
Sign In or Register to comment.