n/a
Dependencies: SoftwareSerial mbed
Fork of XBeeTest by
main.cpp
- Committer:
- yokotay
- Date:
- 2015-12-08
- Revision:
- 2:3b1482a11290
- Parent:
- 1:69c55857d969
File content as of revision 2:3b1482a11290:
#include "mbed.h" #include "SoftwareSerial.h" SoftwareSerial xbee1(D3, D2); DigitalOut myled(LED1); Serial pc(USBTX, USBRX); int main() { char buffer[256]; char *p; xbee1.baud(9600); int count = 1; myled = 0; while (1) { sprintf(buffer, "%d: (yokota) hello.\r\n", count++); pc.puts(buffer); //for debugging: print to pc p = buffer; while (*p) { xbee1.putc(*p++); wait_ms(2); //required for stable communication } wait_ms(1000); myled = 1 - myled; } }