xbed Lpc1768 Radio Test

Dependencies:   MxRadioRF2xx mbed

Fork of xBedRadio by Fred Qian

Files at this revision

API Documentation at this revision

Comitter:
fredqian
Date:
Thu Apr 09 08:50:55 2015 +0000
Commit message:
MxRadio Examples

Changed in this revision

MxRadioRF2xx.lib Show annotated file Show diff for this revision Revisions of this file
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
diff -r 000000000000 -r ba3b92501bea MxRadioRF2xx.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MxRadioRF2xx.lib	Thu Apr 09 08:50:55 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/teams/Smeshlink/code/MxRadioRF2xx/#5f1d66c85ae0
diff -r 000000000000 -r ba3b92501bea main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Apr 09 08:50:55 2015 +0000
@@ -0,0 +1,39 @@
+#include "mbed.h"
+#include "MxRadio.h"
+DigitalOut myled1(LED1);
+DigitalOut myled2(LED2);
+cMxRadio MxRadio(P0_18, P0_17, P0_15, P0_20, P2_11,P2_12, P2_13);
+uint8_t i;
+void errHandle(radio_error_t err)
+{
+    myled2=!myled2;
+}
+void onXmitDone(radio_tx_done_t x)
+{
+    myled2=!myled2;
+}
+uint8_t* recievehandler(uint8_t len, uint8_t* frm, uint8_t lqi, int8_t ed,uint8_t crc_fail)
+{
+
+    myled1=!myled1;
+
+    return frm;
+}
+int main() {
+
+    myled2=1;
+    myled1=1;
+    MxRadio.begin(0);
+    MxRadio.attachError(errHandle);
+    MxRadio.attachTxDone(onXmitDone);
+    MxRadio.attachReceiveFrame(recievehandler);
+    while(1) {
+        MxRadio.beginTransmission();
+        MxRadio.write("Hello World!");
+        MxRadio.write(i);
+        i++;
+        MxRadio.endTransmission();
+        wait_ms(1000);
+
+    }
+}
diff -r 000000000000 -r ba3b92501bea mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Apr 09 08:50:55 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/487b796308b0
\ No newline at end of file