I recently bought an esp32 display thingy and a couple nrf24l01s. I am planning the use the esp and nrf as a remote for a project I am making. My question is if it would be possible to not have to use a separate module connected to the esp and have it act like it has a built in nrfl01. Since the esp and nrf both work in the 2.4ghz frequency range I was thinking this might be possible.
While waiting for more precise replies, read the datasheets, application notes and eventual examples. It looks like thinkable to me but I have no close knowledge.
If it helps, here is a tested example of a RF24 module connected to an ESP32 DevKit board. It is a slave (receiver) only, but could be the basis for a master (transmitter) as well.
// SimpleRx - the slave or the receiver
//name >> rf24 pin >> ESP32 pin
//MOSI 6 23
//MISO 7 19
//SCK 5 18
//Vcc 2 3.3V
// 10uF electrolytic cap between Vcc and GND on the module
//GND 1 GND
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#define CE_PIN 22 // rf24 pin 3
#define CSN_PIN 21 // rf24 pin 4
const byte thisSlaveAddress[5] = {'R','x','A','A','A'};
RF24 radio(CE_PIN, CSN_PIN);
char dataReceived[14]; // this must match dataToSend in the TX
bool newData = false;
//===========
void setup() {
Serial.begin(115200);
Serial.println("SimpleRx Starting");
radio.begin();
radio.setDataRate( RF24_250KBPS );
radio.openReadingPipe(1, thisSlaveAddress);
radio.startListening();
}
//=============
void loop() {
getData();
showData();
}
//==============
void getData() {
if ( radio.available() ) {
radio.read( &dataReceived, sizeof(dataReceived) );
newData = true;
}
}
void showData() {
if (newData == true) {
Serial.print("Data received ");
Serial.println(dataReceived);
newData = false;
}
}