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.
Fork of Xbee_transmitter by
Revision 0:e7abcef0b57f, committed 2012-12-07
- Comitter:
- abarve9
- Date:
- Fri Dec 07 07:29:32 2012 +0000
- Child:
- 1:004033e7a7c7
- Commit message:
- The transmitter code used to transmit characters wirelessly using Zigbee protocol.
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Fri Dec 07 07:29:32 2012 +0000
@@ -0,0 +1,44 @@
+/// SENDER ZIGBEE
+
+#include "mbed.h"
+#include "iostream"
+#include "stdio.h"
+#include "stdlib.h"
+using namespace std;
+
+Serial pc(USBTX, USBRX);
+
+Serial xbee1(p9,p10);
+DigitalOut rst1(p11); //Digital reset for the XBee, 200ns for reset
+
+
+DigitalOut myled(LED1);//Create variable for Led 3 on the mbed
+
+int main()
+{
+ int character;
+ char buffer[20];
+ rst1 = 0; //Set reset pin to 0
+ myled = 0;//Set LED3 to 0
+ wait_ms(1);//Wait at least one millisecond
+ rst1 = 1;//Set reset pin to 1
+ wait_ms(1);//Wait another millisecond
+
+
+ while (1)
+
+ {
+ if(pc.readable()) {
+ //pc.gets(buffer,10);
+ //xbee1.putc(buffer); //XBee write whatever the PC is sending
+ myled = !myled;
+ character = pc.getc();
+ xbee1.putc(character);
+ pc.putc(character);
+
+ }
+
+ //pc.printf("I got %s on sending side \n", buffer);
+ wait(.1);
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Dec 07 07:29:32 2012 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/49c296715c73 \ No newline at end of file
