![](/media/cache/group/V2.png.50x50_q85.png)
FN
Dependencies: mbed RF24Network RF24
Diff: main.cpp
- Revision:
- 3:e9c4d66da50c
- Parent:
- 2:608cf8c5c55e
- Child:
- 4:93d0253a8a32
--- 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); } }