RF help needed
I want to build a handheld box that has two buttons on it, one for up nd one for down. I'll probably use an SX chip on each end for cost reasons. What the receiver does is take the received info, and do one of two things:
1. Send a 4 bit addess of 0000 followed by a single "start" bit to a servo controller after 10 ms. I'll bump this up to 24 volts with optos.
2. Send a 4 bit address of 0001 followed by a single "start" bit to a servo controller.
Having never done anything with wireless, here is what I thought would work ok with the SX:
(I don't know the SX language so just for the concept)
Main:
If UPbut = 1 then MoveUp
If Dnbut = 1 then MoveDn
Goto Main
MoveUp:
'Some method of transmitting via the Parallax 433mghz transmitter the following byte: 00000000 for address
Pause 10
'Some method to transmit a start bit.
Pause 50
If Upbut = 1 'loops this if button held
goto MoveUp
Goto Main
MoveDn:
'Some method of transmitting via the Parallax 433mghz transmitter the following byte: 00000001 for address
Pause 10
'Some method to transmit a start bit.
Pause 50
If Dnbut = 1 'loops this if button held
goto MoveUp
Goto Main
Does this make sense above? I am not sure how to send the subsequent Start bit. I assume I'll have to send a full byte, maybe 11111111 and then the receving SX wil have to receive two bytes, first the address and then the start. Can anyone point me ion a direction to learn how to send two bytes and receive two bytes, then act on those received bytes.
On the receiver I guess it would resemble:
Main:
Getbytes: 'some method of receiveing bytes here from 433 mhz receiver
If Byte1 = 11111111
then if Addressbyte = 00000001
Pin1 = 1 'address out a to controller
Pin2 = 0 'address out b
Pin3 = 0 'address out c
Pin4 = 0 'address out d
Pause 10
Pin5 = 1 'start pulse to controller
Pause 4
Pin1 = 0 'address out a reset to 0
Pin2 = 0 'address out b
Pin3 = 0 'address out c
Pin4 = 0 'address out d
Pin5 = 0 'reset Start to 0
If Byte1 = 11111111
then if Addressbyte = 00000000
Pin1 = 0 'address out a to controller
Pin2 = 0 'address out b
Pin3 = 0 'address out c
Pin4 = 0 'address out d
Pause 10
Pin5 = 1 'start pulse to controller
Pause 4
Pin1 = 0 'address out a reset to 0
Pin2 = 0 'address out b
Pin3 = 0 'address out c
Pin4 = 0 'address out d
Pin5 = 0 'reset Start to 0
Goto Main
Thanks for any tips on where to start figuring this out
1. Send a 4 bit addess of 0000 followed by a single "start" bit to a servo controller after 10 ms. I'll bump this up to 24 volts with optos.
2. Send a 4 bit address of 0001 followed by a single "start" bit to a servo controller.
Having never done anything with wireless, here is what I thought would work ok with the SX:
(I don't know the SX language so just for the concept)
Main:
If UPbut = 1 then MoveUp
If Dnbut = 1 then MoveDn
Goto Main
MoveUp:
'Some method of transmitting via the Parallax 433mghz transmitter the following byte: 00000000 for address
Pause 10
'Some method to transmit a start bit.
Pause 50
If Upbut = 1 'loops this if button held
goto MoveUp
Goto Main
MoveDn:
'Some method of transmitting via the Parallax 433mghz transmitter the following byte: 00000001 for address
Pause 10
'Some method to transmit a start bit.
Pause 50
If Dnbut = 1 'loops this if button held
goto MoveUp
Goto Main
Does this make sense above? I am not sure how to send the subsequent Start bit. I assume I'll have to send a full byte, maybe 11111111 and then the receving SX wil have to receive two bytes, first the address and then the start. Can anyone point me ion a direction to learn how to send two bytes and receive two bytes, then act on those received bytes.
On the receiver I guess it would resemble:
Main:
Getbytes: 'some method of receiveing bytes here from 433 mhz receiver
If Byte1 = 11111111
then if Addressbyte = 00000001
Pin1 = 1 'address out a to controller
Pin2 = 0 'address out b
Pin3 = 0 'address out c
Pin4 = 0 'address out d
Pause 10
Pin5 = 1 'start pulse to controller
Pause 4
Pin1 = 0 'address out a reset to 0
Pin2 = 0 'address out b
Pin3 = 0 'address out c
Pin4 = 0 'address out d
Pin5 = 0 'reset Start to 0
If Byte1 = 11111111
then if Addressbyte = 00000000
Pin1 = 0 'address out a to controller
Pin2 = 0 'address out b
Pin3 = 0 'address out c
Pin4 = 0 'address out d
Pause 10
Pin5 = 1 'start pulse to controller
Pause 4
Pin1 = 0 'address out a reset to 0
Pin2 = 0 'address out b
Pin3 = 0 'address out c
Pin4 = 0 'address out d
Pin5 = 0 'reset Start to 0
Goto Main
Thanks for any tips on where to start figuring this out