NRF24L01 PROBLEM

hello my name is angelos and i am working on a project with nrf24l01 transmitter the problem is i have to touch the ce pin and then send once the packege and stops i have too touch again the ce to send the next value any idea ?

here is the code :

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#define CE_PIN 7
#define CSN_PIN 8

const uint64_t pipe = 0xE8E8F0F0E1LL;
RF24 radio(CE_PIN, CSN_PIN);
int forward_backward=A0;
int left_right=A1;
int brake=A2;
int joystick[3];

void setup()
{
Serial.begin(9600);
radio.begin();
radio.openWritingPipe(pipe);
radio.setRetries(15, 15);
}

void loop()
{
joystick[0] = analogRead(forward_backward);
joystick[1] = analogRead(left_right);
joystick[2] =analogRead(brake);
joystick[0] = map(joystick[0], 0, 1023, 0, 255);
joystick[1] = map(joystick[1], 0, 1023, 0, 255);
joystick[2] = map(joystick[2], 0, 1023, 0, 255);
radio.write(joystick, sizeof(joystick) );
Serial.println(joystick[0]);
delay(1000);
Serial.println(joystick[1]);
delay(1000);
Serial.println(joystick[2]);
delay(1000);
Serial.println("hahahah");
delay(1000);
}

here is the received code :

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#define CE_PIN 7
#define CSN_PIN 8

const uint64_t pipe = 0xE8E8F0F0E1LL;
RF24 radio(CE_PIN, CSN_PIN);
int joystick[3];

void setup()
{
Serial.begin(9600);
delay(1000);
Serial.println("Nrf24L01 Receiver Starting");
radio.begin();
radio.openReadingPipe(1,pipe);
radio.startListening();;
}

void loop()
{
if ( radio.available() )
{
// Read the data payload until we've received everything
bool done = false;
while (!done)
{

done=radio.read(joystick, sizeof(joystick) );

Serial.print("forward_backward_value = ");
Serial.print(joystick[0]);
delay(1000);
Serial.print(" left_right_value = ");
Serial.println(joystick[1]);
delay(1000);
Serial.print(" brake_value = ");
Serial.println(joystick[2]);
delay(1000);
}
}
else
{
Serial.println("No radio available");
}

}

Hi,

I'm experiencing similar, but not quite the same, issues.

Firstly, these are very sensitive to power fluctuations, have you tried soldering an electrolytic capacitor (approx. 10uF) across the GND and Vcc pins on the radio unit itself? - Remember polarity of the capacitor!!! This can have a dramatic effect on your results.

Secondly, the problem I'm experiencing is when there are delays in the code - have you tried it without the delay(1000) commands?

dh68 thanks too much the problem solved it was the delay

Glad I could help :slight_smile:

Just to let you know, I appear to have solved my issue with delay and RF24 radio; it appears it's an issue with the maniac bug library - I'm using the fork of this library available at

http://tmrh20.github.io/RF24/

and the issues have gone away. Would recommend taking a look at it before you continue with your project.