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 DigitalOut myled(LED1); 00005 XBee xbee(p13, p14); 00006 XBeeAddress64 remoteAddress = XBeeAddress64(0x0013A200, 0x40319F25); 00007 00008 int main() { 00009 uint8_t Cmd[] = {'D', '4'}; 00010 uint8_t Low[] = {0x04}; 00011 uint8_t High[] = {0x05}; 00012 RemoteAtCommandRequest remoteAtRequest; 00013 00014 wait(1); 00015 xbee.begin(9800); 00016 00017 remoteAtRequest = RemoteAtCommandRequest(remoteAddress, Cmd, Low, sizeof(Low)); 00018 remoteAtRequest.setApplyChanges(true); 00019 00020 while(1) { 00021 myled = 1; 00022 remoteAtRequest.setCommandValue(Low); 00023 remoteAtRequest.setCommandValueLength(sizeof(Low)); 00024 xbee.send(remoteAtRequest); 00025 myled = 0; 00026 wait(1); 00027 00028 myled = 1; 00029 remoteAtRequest.setCommandValue(High); 00030 remoteAtRequest.setCommandValueLength(sizeof(High)); 00031 xbee.send(remoteAtRequest); 00032 myled = 0; 00033 wait(1); 00034 } 00035 }
Generated on Sat Jul 16 2022 09:31:59 by
1.7.2