I use ChinaChinese clone nRF24L01. It washas very narrow voltage tolerance. My arduinoArduino is also clone. The 3.3V output voltage was 3.27. The nRF24L01 was not working. I added a 3 terminal regulator between Arduino 5V output pin and nRF24L01. The voltage was 3.303V. Then nRF24L01 was working normally.
/////////////////////////////////////////////// #include <SPI.h> #include <nRF24L01.h> #include <RF24.h> RF24 radio(9, 10); const byte rxAddr[6] = "00001"; void setup() { radio.begin(); radio.setRetries(15, 15); radio.openWritingPipe(rxAddr); radio.stopListening(); pinMode(4,OUTPUT); } void loop() { const char text[] = "Kawasaki_JP"; radio.write(&text, sizeof(text));
delay(1000); } ////////////////////////////////////////////////
#include <SPI.h> #include <nRF24L01.h> #include <RF24.h> RF24 radio(9, 10); const byte rxAddr[6] = "00001"; void setup() { Serial.begin(9600); while (!Serial); radio.begin(); radio.openReadingPipe(0, rxAddr); radio.startListening(); } void loop() { if (radio.available()) { char text[32] = {0}; radio.read(&text, sizeof(text)); Serial.println(text); } } ////////////////////////////////////////////
///////////////////////////////////////////////
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(9, 10);
const byte rxAddr[6] = "00001";
void setup()
{
radio.begin();
radio.setRetries(15, 15);
radio.openWritingPipe(rxAddr);
radio.stopListening();
pinMode(4,OUTPUT);
}
void loop()
{
const char text[] = "Kawasaki_JP";
radio.write(&text, sizeof(text));
delay(1000);
}
////////////////////////////////////////////////
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(9, 10);
const byte rxAddr[6] = "00001";
void setup()
{
Serial.begin(9600);
while (!Serial);
radio.begin();
radio.openReadingPipe(0, rxAddr);
radio.startListening();
}
void loop()
{
if (radio.available())
{
char text[32] = {0};
radio.read(&text, sizeof(text));
Serial.println(text);
}
}
////////////////////////////////////////////