would using 2 different frequency modules be perfect?
TLP434A - 433.92MHz
TLP418A - 418MHz
**broken link removed**
say your working with 2400 baud, if you made the controller the master and by doing so, it controlled the data flow i.e.
codes:
"C", 10,Speed - Tell car to go back with the value of speed
"C", 20,Speed - Tell car to go forward with the value of speed
"C", 30,Angle - Tell car to turn left by the amount of angle
"C", 40,Angle - Tell car to turn right by the amount of angle
"S1", 10 - command sensor 1 to send its data now
"S2", 11 - command sensor 1 to send its data now
"S3", 12 - command sensor 1 to send its data now
Make a small program that records how many ms it takes to sample and send the sensor data, and make that time the time_out for the wait on the reply on the master (controller)
say it took 1ms to sample and another 20ms to send the data from the sensor, then from the controller:
Time_Out: 'If it took more than 25ms, come straight to here
SEROUT PORTA.0, 396, ["S1", 10, "A"] 'Tell sensor 1 to send data
SERIN PORTA.0 , 396, 21, Time_Out, [ WAIT( "S1" ), SERDATA]
'Do what you want with the SERDATA
and on the reciever
Time_Out:
SERIN PORTA.0 , 396, 20, Time_Out, [ WAIT( "S1" ), SERDATA] 'wait for controller to request a new value
SERDATA = ADIN 4
SEROUT PORTA.0, 396, ["S1", SERDATA, "A"] 'send the new sensor value
SERDATA = 0 'reset the data
Goto Time_Out ' go and wait for the next request
Car Program;
Time_Out:
SERIN PORTA.0 , 396, 20, Time_Out, [ WAIT( "C" ), SERDATA, Speed] 'wait for new data
If SERDATA = 10 then
'make it go as fast as the value Speed
Elseif SERDATA = 20 then
'backwards
Elseif SERDATA = 30
'left by speed value
Elseit SERDATA = 40
'right by speed value
Endif
Goto Time_Out
Controller;
'decode user inputs and determine serdata and speed values
SEROUT PORTA.0, 396, ["C", SERDATA, Speed, "A"] 'send the new car data
Its all mumbo jumbo i know, but work with me here