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.
Dependencies: SoftwareSerial mbed
Fork of XBeeTest by
main.cpp
00001 #include "mbed.h" 00002 #include "SoftwareSerial.h" 00003 00004 SoftwareSerial xbee1(D3, D2); 00005 DigitalOut myled(LED1); 00006 Serial pc(USBTX, USBRX); 00007 00008 int main() { 00009 char buffer[256]; 00010 char *p; 00011 00012 xbee1.baud(9600); 00013 int count = 1; 00014 myled = 0; 00015 00016 while (1) { 00017 sprintf(buffer, "%d: (yokota) hello.\r\n", count++); 00018 pc.puts(buffer); //for debugging: print to pc 00019 p = buffer; 00020 while (*p) { 00021 xbee1.putc(*p++); 00022 wait_ms(2); //required for stable communication 00023 } 00024 wait_ms(1000); 00025 myled = 1 - myled; 00026 } 00027 }
Generated on Tue Jul 12 2022 21:48:36 by
1.7.2
