Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
00001 #include "mbed.h" 00002 #include "xbee.h" 00003 00004 xbee xbee1(p9,p10,p11); //Initalise xbee_lib 00005 00006 int main() 00007 { 00008 int device_serial[8]; 00009 int security_key[8]; 00010 int Pan_ID; 00011 char send_data[202]; //The buffer inside the Xbee can only store 202 bytes 00012 char read_data[202]; //The buffer inside the Xbee can only store 202 bytes 00013 00014 xbee1.ConfigMode(); //Enter the xbee's config mode 00015 xbee1.GetSerial(device_serial); //Read the xbee devices serial into device_serial 00016 xbee1.SetKey(security_key); //Set the network key to security_key 00017 xbee1.SetPanId(Pan_ID); // set the PAN network id to Pan_ID 00018 xbee1.WriteSettings(); // Write the settings to non volatile memory 00019 xbee1.ExitConfigMode(); //Exit config mode 00020 xbee1.reset(); //Reset Xbee 00021 00022 xbee1.SendData(send_data); //Send the data in send_data 00023 xbee1.RevieveData(read_data); //Put recieved data into read_data 00024 00025 00026 }
Generated on Sat Jul 23 2022 04:52:31 by
1.7.2