I'm reading RSSI value of xbee ( naturally there is another xbee emitter also) with followed code part(in AT mode).But in my project i should take 3 RSSI values from 3 xbee (emitter) and these values should be received by one xbee and arduino.Namely,How can i see SEPERATELY those 3 values in one xbee and connected arduino?I need an urgent help,if you could help i'd be so happy.
int digitalPin = 10; // the RSSI pin 6 of Xbee is connected to this PWM Pin. (Digital Pin 10)
int rssiDur; // Variable for RSSI
void setup()
{
Serial.begin(9600);
}
void loop()
{
rssiDur = pulseIn(digitalPin, LOW, 200); // get's the RSSI Value
Serial.println(rssiDur); //for debbuging and first setup.
}
Namely,How can i see SEPERATELY those 3 values in one xbee and connected arduino?
Each Arduino will need to ask it's XBee for it's RSSI value. Each Arduino can then use the attached XBee to send that value, with an identifier to another XBee, connected to a coordinator.
What is the problem?
I hope you are not expecting to use the RSSI values to determine distance. That is not going to work. The correlation between RSSI and distance is poor (at best).
fbg25:
Namely,How can i see SEPERATELY those 3 values in one xbee and connected arduino?
So 3 separate Arduinos are sending values to a single Arduino (over XBee)? In that case, you need some sort of identifier, like an address, to indicate whose value that is.
fbg25:
Namely,How can i see SEPERATELY those 3 values in one xbee and connected arduino?
So 3 separate Arduinos are sending values to a single Arduino (over XBee)? In that case, you need some sort of identifier, like an address, to indicate whose value that is.
You have to come up with a protocol. A simple one would include a start byte, delimiter and stop byte. Anything between the start byte and deliminator is the "address". Anything between the delimiter and the stop byte is the value. Example:
"<1:123>"
The '<' and the '>' are the start and stop bytes, respectively. the '1' is the address. the ':' is the delimiter. The "123" is the value. Since it's ASCII encoded, you'll need to use something like atoi() to convert the values into actual numeric values.
If you configure and use the coordinator in api mode you could send a remote at command to each xbee radio to get the last rssi value and can than do whatever you want at the coordinator.