RF Transmitter & Receiver - Newbie
Hi all, I hope that i'm not wasting you alls valued time. I'm trying to learn about the RF Xmitter & Receiver.
what I would like to do is to trigger a device on connected to the RF receiver (RF receiver & stamp#1) by way of pressing a button on the Xmit side (with RF & stamp#2). In other words, i have two basic stamps separate from each other. On one stamp i have the RF Xmitter, and the other stamp i have the RF Xmitter. I would like to press a button on the RF Xmitter and have the RF Receiver receive the signal and turn on a led. Any help would be appreciated. Thanks in advance.
what I would like to do is to trigger a device on connected to the RF receiver (RF receiver & stamp#1) by way of pressing a button on the Xmit side (with RF & stamp#2). In other words, i have two basic stamps separate from each other. On one stamp i have the RF Xmitter, and the other stamp i have the RF Xmitter. I would like to press a button on the RF Xmitter and have the RF Receiver receive the signal and turn on a led. Any help would be appreciated. Thanks in advance.
Comments
These transmit a 4 byte value from one Stamp to the other via the RF transmitter and receiver. You could transmit a single byte from one to the other and use a value of zero for off and one for on. The receiving Stamp simply copies the value to an I/O pin set to output mode, then goes back to wait for another message. The same sort of thing goes on at the transmit end. You can use the BUTTON statement if you want. When the state of the button changes, you send the new state as a byte value (with the "sync" character as shown in the examples).
STAMP #1 (RF Xmit):
x VAR Byte
DO
PULSOUT 8, 1200 'Sync pulse for the receiver
SEROUT 8, 16468, [noparse][[/noparse]DEC 0011 ]
PAUSE 5
STAMP#2 (RF TX):
x VAR BYTE
DO
LOW 0
SERIN 7, 16468, [noparse][[/noparse]DEC x]
HIGH 0
DEBUG ? x
LOOP
I thought that I would see the same value (0011) on the RX debug but I saw the following:
x = 8
x = 8
x = 8
x = 8
x = 8
x = 8
x = 8
x = 8
x = 8
x = 0
x = 0
x = 0
x = 8
x = 8
x = 8
x = 0
x = 0
x = 8
x = 0
x = 8
x = 0
x = 8
x = 8
x = 4
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen