I have a problem with the low speed of transferring data through the NRF24L01 modules. I use transmitting and receiving codes below:
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8); // CE, CSN
const byte address[6] = "00009";
void setup() {
radio.begin();
radio.openWritingPipe(address);
radio.stopListening();
}
void loop() {
const char text[] = "Hi Hamid";
radio.write(&text, sizeof(text));
delay(1000);
}
receiving code:
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
//create an RF24 object
RF24 radio(7, 8); // CE, CSN
//address through which two modules communicate.
const byte address[6] = "00009";
void setup()
{
while (!Serial);
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(0, address);
radio.startListening();
}
void loop()
{
if (radio.available())
{
char text[32] = {0};
radio.read(&text, sizeof(text));
Serial.println(text);
}
}
srnet
August 15, 2021, 7:01pm
2
You need to explain what you mean by 'slow speed'
Please follow the advice given in the link below when posting code . Use code tags when posting code here to make it easier to read and copy for examination
Hello,
Welcome to the Arduino Forum.
This guide explains how to get the best out of this forum. Please read and follow the instructions below.
Being new here you might think this is having rules for the sake of rules, but that is not the case. If you don’t follow the guidelines all that happens is there is a long exchange of posts while we try to get you to tell us what we need in order to help you, which is frustrating for you and frustrating for us.
The people who try to help with your pro…
What slow speed are you talking about?
Sending a single packet each second is not the way to test the speed of an NRF module.
Using 9600 baud to echo all packets to the serial port is the biggest bottleneck you constructed,
but should in no way impact the transmission of your single packet.
If you want to be as fast as possible, you should use dynamic payloads,
in your current setting all packets will carry 32 byte of data.
system
Closed
December 15, 2021, 7:10am
5
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.