Example RF24Network receive program. Tested on Nucleo 411.

Dependencies:   RF24 RF24Network mbed

Files at this revision

API Documentation at this revision

Comitter:
akashvibhute
Date:
Thu Nov 05 06:32:20 2015 +0000
Parent:
2:608cf8c5c55e
Commit message:
updated library 05/nov/2015

Changed in this revision

RF24.lib Show annotated file Show diff for this revision Revisions of this file
RF24Network.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
--- a/RF24.lib	Mon Jul 06 05:23:41 2015 +0000
+++ b/RF24.lib	Thu Nov 05 06:32:20 2015 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/users/akashvibhute/code/RF24/#00706a42491e
+http://developer.mbed.org/users/akashvibhute/code/RF24/#e94be00fd19e
--- a/RF24Network.lib	Mon Jul 06 05:23:41 2015 +0000
+++ b/RF24Network.lib	Thu Nov 05 06:32:20 2015 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/users/akashvibhute/code/RF24Network/#caf146ffe8b0
+http://developer.mbed.org/users/akashvibhute/code/RF24Network/#dfc8da7ac18c
--- a/main.cpp	Mon Jul 06 05:23:41 2015 +0000
+++ b/main.cpp	Thu Nov 05 06:32:20 2015 +0000
@@ -10,16 +10,17 @@
 #define spi_MOSI    D4
 #define spi_MISO    D5
 
-RF24 radio(spi_MOSI, spi_MISO, spi_SCK, nrf_CSN, nrf_CE);
+
+RF24 radio(spi_MOSI, spi_MISO, spi_SCK, nrf_CE, nrf_CSN );
 
 // Network uses that radio
 RF24Network network(radio);
 
 // Address of our node
-const uint16_t this_node = 1;
+const uint16_t this_node = 00;
 
 // Address of the other node
-const uint16_t other_node = 0;
+const uint16_t other_node = 01;
 
 // When did we last send?
 unsigned long last_sent;
@@ -32,8 +33,6 @@
 {
     unsigned long ms;
     unsigned long counter;
-
-    float vector_4d[4];
 };
 
 
@@ -42,8 +41,6 @@
     pc.baud(921600);
     wait_ms(1000);
 
-
-
     pc.printf("mBed RF24Network node\n");
     radio.begin();
     network.begin(/*channel*/ 90, /*node address*/ this_node);
@@ -61,7 +58,7 @@
             RF24NetworkHeader header_rx;
             payload_t payload_rx;
             network.read(header_rx,&payload_rx,sizeof(payload_rx));
-            pc.printf("Received packet # %d at %d ms, message: V4 %f, %f, %f, %f \n",payload_rx.counter,payload_rx.ms, payload_rx.vector_4d[0],payload_rx.vector_4d[1],payload_rx.vector_4d[2],payload_rx.vector_4d[3]);
+            pc.printf("Received packet # %d at %d ms\n",payload_rx.counter,payload_rx.ms);
         }
 
     }
--- a/mbed.bld	Mon Jul 06 05:23:41 2015 +0000
+++ b/mbed.bld	Thu Nov 05 06:32:20 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/7cff1c4259d7
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/9296ab0bfc11
\ No newline at end of file