Quantcast
Channel: Seeedstudio Forum
Viewing all articles
Browse latest Browse all 6612

RFbee communication help

$
0
0
Hi,

What you can do at the receiver side is, upload a simple code in the UNO which sends some number, say '1' and is received by the Receiving Uno. The whole communication goes through the pair of RFBee modules both kept in either Rx-Tx mode or Transceiver modes.

Sender code:

Code: void setup()
{               
Serial.begin(9600); // beginning the Serial Communication

// Read the AT Commands section in RFBee Datasheet to understand AT Commands below
//Start control mode in RFBEE using NUM's +++
Serial.print("+++\r");
delay(40);
//Read firmware version (should be 1.1)
Serial.print("ATFV\r");
delay(10);
//Read HW version (should be 1.0)
Serial.print("ATHV\r");
delay(10);
//Read current baud setting (should be 0=9600bps)
Serial.print("ATBD\r");
delay(10);
//set mode, initially it's transceiving
Serial.write("ATMD0\r");
delay(10);
//Set Output format
Serial.write("ATOF3\r"); // Check Datasheet
delay(10);
//Set My (source) Address
Serial.write("ATMA2\r");
delay(10);
//Set Destination Address
Serial.write("ATDA1\r");
delay(10);
Serial.write("ATAC2\r");
delay(10);
Serial.write("ATTH0\r");
delay(10);
Serial.write("ATPA7\r"); Maximum Power, can adjust as per requirement
delay(10);
Serial.write("ATCF5\r"); Least Data rate, can change as per requirement
delay(10);


//Go back to data mode
Serial.print("ATo0\r"); 
}

void loop()
{

     
     Serial.print('1');
     delay (2000); // delay 2 seconds
}


This code would serially send '1' every 2 seconds.

Similarly, you can make the receiving code using Serial.read() command of Arduino Serial library.

Thanks,
Tanmay Chaturvedi

Statistics : Posted by dechaumet.valerian • on Wed May 27, 2015 7:00 pm • Replies 2 • Views 41

Viewing all articles
Browse latest Browse all 6612

Trending Articles