takashi yamanoue / Mbed 2 deprecated XBee_API_ex1

Dependencies:   XBee mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "XBee.h"
00003 
00004 XBee xbee(p13, p14);
00005 
00006 int main() {
00007     uint8_t Cmd[] = {'D', '4'};
00008     uint8_t Low[] = {0x05};
00009     uint8_t Val[] = {0x04};
00010     XBeeAddress64 remoteAddress(0x0013A200, 0x403A8C82);
00011     RemoteAtCommandRequest remoteAtRequest;
00012 
00013     wait(1);
00014     xbee.begin(115200);
00015 
00016     remoteAtRequest = RemoteAtCommandRequest(remoteAddress, Cmd, Low, sizeof(Low));
00017     remoteAtRequest.setApplyChanges(true);
00018 
00019     remoteAtRequest.setCommandValue(Val);
00020     remoteAtRequest.setCommandValueLength(sizeof(Val));
00021     xbee.send(remoteAtRequest);
00022 }