Thank you to anyone reading this, and even more so if you have any help for me. My project for college is to have my robot drive towards wifi hotspots using the RSSI value gained from an XBee. The problem I have is, I dont know enough about arduino language to be able to get the RSSI value from the chip. Any help that can be given to me would be awesome, This is what I have so far:
void initXbee(){
// clear the serial port so no buggy data will be there
Serial.flush();
// delay needed for.. I dont have a f*ckin clue..
delay(1200);
// put xbee in command mode
Serial.print("+++");
// a check could be build in:
/*
char thisByte = 0;
while (thisByte != '\r'){ // wait for the xbee to respond, being in command mode
if (Serial.available() > 0){
thisByte = Serial.read();
}
}
*/
// but that is not really needed in my opinion
// and I just use a delay
delay(500);
// set the low part of the address to 0 and the high part to FFFF => broadcast mode
Serial.print("ATDH0,DLFFFF,");
delay(10);
// set the xbee's own address
Serial.print("MY1,"); // of 4
delay(10);
/* // set the network id, choose a strange key
// in this case 8 = lucky number in china
Serial.print("ID8888,");
delay(10);*/
// set the api mode to 1
// 0 = no rssi
// 1 = rssi
// 2 = rssi with escaping
Serial.print("AP1,");
delay(10);
// set the rssi value
// I think this is only usefull if you use the analog pin on the xbee itself to read the rssi ** after finishing this project i read something different about this, cant remember where **
// see the xbee manual for more details
Serial.print("RP40,");
delay(10);
// set the boudrate to 9600
// this will give the highest speed with no data buffering on the xbee
// see the xbee manual for more details
Serial.print("BD3,");
delay(10);
// exit command mode
Serial.print("CN");
// wait for a while
// delay(1200);
}
Any help would be wonderful. Thanks again for your time.