Master (transmitter) example of using nRF24L01 with STM32F407VET6.

Dependencies:   mbed RF24

Master (transmitter) example of using nRF24L01 with STM32F407VET6 black boards.

/media/uploads/hudakz/nrf24l01_2rY1GYr.png


Connect (plug in) the nRF24L01 module to the NRF24L01 connector located on the STM32F407VET6 board as follows:

nRF24L01STM32F407VET6
Vcc+3.3V
GNDGND
MOSIPB_5 (SPI1 MOSI)
MISOPB_4 (SPI1 MISO)
SCKPB_3 (SPI1 SCK)
CSNPB_7 (CS)
CEPB_6 (CE)

Files at this revision

API Documentation at this revision

Comitter:
hudakz
Date:
Fri Jan 25 14:02:18 2019 +0000
Parent:
1:af5178c64266
Commit message:
Updated.

Changed in this revision

RF24.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
--- a/RF24.lib	Wed Jan 23 17:44:06 2019 +0000
+++ b/RF24.lib	Fri Jan 25 14:02:18 2019 +0000
@@ -1,1 +1,1 @@
-https://os.mbed.com/users/hudakz/code/RF24/#2007da485383
+https://os.mbed.com/users/hudakz/code/RF24/#d96c2056bf37
--- a/main.cpp	Wed Jan 23 17:44:06 2019 +0000
+++ b/main.cpp	Fri Jan 25 14:02:18 2019 +0000
@@ -4,13 +4,16 @@
 const uint64_t  SLAVE_ADDRESS = 0xF0F0F0F0F0F0F001L;    // slave's address
 
 DigitalOut      led(PA_6);                              // LED1
-RF24            radio(PB_5, PB_4, PB_3, PB_7, PB_6);    // mosi, miso, sck, csn, ce, (irq is not connected/used)
+RF24            radio(PB_5, PB_4, PB_3, PB_7, PB_6);    // mosi, miso, sck, csn, ce, (irq not used)
 uint8_t         payload;
 
 int main()
 {
     // Initialize nRF24L01
-    radio.begin();
+    if (!radio.begin()) {
+        printf("Failed to initialize nRF24L01. Check whether connected.\r\n");
+        return -1;  // Exit the program
+    }
     radio.setPALevel(RF24_PA_LOW);
     radio.setRetries(5, 15);
     radio.setPayloadSize(sizeof(payload));