Shop OBEX P1 Docs P2 Docs Learn Events
Mars Mission with 433MHz RF Transceiver (27982) — Parallax Forums

Mars Mission with 433MHz RF Transceiver (27982)

Posted in category "Customer Projects" also.

Hello everyone I posted another thread previously that was asking for a lot more. This one is going to be a little simpler. I am designing a lesson plan where students build a boe-bot (board of education BS2) that drives around an environment looking for water. I have the IR navigation down, and the photoresister detecting a numeric value range for a specific color. The robot is successful in stopping when that color is detected. What I am having trouble with is the wireless transmission of data using the 433MHz RF Transceiver (27982). I have never worked with this accessory and all i can find on coding it is from the tech sheet PDF for the transceiver. Alone, I can get that coding to send signal and successfully count like it should but that is not what I want it to do. Is there a way to send data from one transceiver to the other and light up an LED, play a sound, or debug a specific phrase? Bellow are the only transmit and receive codes that I know / can find. Would need help with the coding to do the task(s) I am looking for and also wiring. Thanks in advance for any help.


Transmit: 'This was a basic transmit code from the 433MHz RF Transceiver (#27982) PDF
HIGH 5

PULSOUT 4, 1200
SEROUT 4, 16468, [ "!", x.HIGHBYTE, x.LOWBYTE, y.HIGHBYTE, y.LOWBYTE ]
x = x + 1
y = y + 1
PAUSE 10 'How do i control an LED on the recieving robot or make it debug "We Found Water"??



Receive:
' {$STAMP BS2}
' {$PBASIC 2.5}


x VAR Word
y VAR Word


LOW 5

DO
LOW 4
SERIN 4, 16468, [WAIT("!"),x.HIGHBYTE, x.LOWBYTE, y.HIGHBYTE, y.LOWBYTE]
HIGH 4
DEBUG ? x
DEBUG ? y
LOOP



GOSUB Transmit is where i would be plugging this code in. When the robot detects the value 601-799 it pause at the "water" and needs to signal the other robot via wireless that it found the water in one way or another. Also with having the current transmit code in it transmits the whole time. How do I get it to only transmit when it finds the "Water"

Check_Water: 'Photoresistor code modifyed from our basic sumo bot competition
HIGH 9
PAUSE 2
RCTIME 9, 1, light
DEBUG HOME, DEC5 light
IF light > 800 THEN RETURN 'Using LEDs to illuminate the surface right next to the photoresistor for more accurate and consistent values
IF light < 600 THEN RETURN
HIGH 14
HIGH 1
PAUSE 10000
LOW 14
LOW 1
GOSUB Transmit 'how do i get this to not transmit the whole time?
PAUSE 10000
GOSUB Drive_Forward 'would prefer that they stop here. want the robot to stay at the "water"
'When I had it stop here it was messing with the rest of the IR Navigation coding and wouldnt drive at all
RETURN

Comments

  • Current wiring of the Transceiver

    GND - VSS
    Vin - VDD
    Data - P4
    Tx-Rx - P5
    PDN - Not Connected
    RSSI - Not Connected
  • PublisonPublison Posts: 12,366
    edited 2018-05-22 23:32
    Your other post in Customer Projects had to be deleted as it was not a completed project, and also it is against forum rules to post the same thread in two forums.

    This post will be moved to the Basics Stamp forum, as it will be more visible to those that can answer your questions.

    When posting code, use the "C" ,"Code" function in the post to keep indentations intact.
Sign In or Register to comment.