asdasdasdas
Dependencies: mbed RF24Network RF24
Revision 4:93d0253a8a32, committed 2019-01-21
- Comitter:
- wesleytiem
- Date:
- Mon Jan 21 15:03:09 2019 +0000
- Parent:
- 3:e9c4d66da50c
- Commit message:
- c'est bon
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r e9c4d66da50c -r 93d0253a8a32 main.cpp --- a/main.cpp Thu Nov 05 06:32:20 2015 +0000 +++ b/main.cpp Mon Jan 21 15:03:09 2019 +0000 @@ -4,14 +4,7 @@ Serial pc(USBTX, USBRX); -#define nrf_CE D9 -#define nrf_CSN D10 -#define spi_SCK D3 -#define spi_MOSI D4 -#define spi_MISO D5 - - -RF24 radio(spi_MOSI, spi_MISO, spi_SCK, nrf_CE, nrf_CSN ); +RF24 radio(SPI_MOSI, SPI_MISO, SPI_SCK, D9, SPI_CS ); // Network uses that radio RF24Network network(radio); @@ -38,7 +31,7 @@ int main() { - pc.baud(921600); + pc.baud(115200); wait_ms(1000); pc.printf("mBed RF24Network node\n"); @@ -50,7 +43,7 @@ { // Pump the network regularly network.update(); - + // Is there anything ready for us? while ( network.available() ) { @@ -58,7 +51,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\n",payload_rx.counter,payload_rx.ms); + pc.printf("Received packet # %d at %d ms\r\n",payload_rx.counter,payload_rx.ms); } }