rf24 error messages

At the bottom is my error messages. They do not prevent compile or upload, but the end result is that I do not receive data.

Here is my codes.

The rig is a quadruped robot body, where two of the legs will be able to move by remote control, each leg has a button on the controller, hitting the button selects the leg, and allows for the foot position to be moved along a coordinate field using a joystick axis for each of x, y, and z.

the controller is an arduino as well, and has two joysticks with only three of the axis’ connected, and two buttons. The communication is via nrf2401.

Transmit

#include<SPI.h>
#include<RF24.h>

#define joyStick_x A0
#define joyStick_y A1
#define joyStick_z A2
#define leftFrontSelect 4
#define rightFrontSelect 2
const int lf_on = 5;
const int rf_on = 3;

int lfs_button = 0;
int rfs_button = 0;
int lfs_led = 0;
int rfs_led = 0;

RF24 radio (7,8);

byte addresses [][10] = {"1Node","2Node"};

struct dataStruct 
{
  int Xposition;
  int Yposition;
  int Zposition;
  int lf_select;
  int rf_select;
} myData;
void setup() {
  // put your setup code here, to run once:
pinMode(leftFrontSelect, INPUT);
pinMode(rightFrontSelect, INPUT);
pinMode(lf_on, OUTPUT);
pinMode(rf_on, OUTPUT);
digitalWrite(lf_on, LOW);
digitalWrite(rf_on, LOW);
Serial.begin(115200);
radio.begin();
radio.setChannel(108);
radio.setDataRate(RF24_250KBPS);
radio.setPALevel(RF24_PA_LOW);
radio.openWritingPipe(addresses[0]);
radio.openReadingPipe(1,addresses[1]);
radio.startListening();

}

void loop() {
  // put your main code here, to run repeatedly:
lfs_button = digitalRead(leftFrontSelect);
rfs_button = digitalRead(rightFrontSelect);

if(lfs_button == HIGH)
{
  Serial.println(lfs_button);
  
  if (lfs_led == 0)
  {
    digitalWrite(lf_on, HIGH); 
    digitalWrite(rf_on, LOW);
  lfs_led = 1; 
  rfs_led = 0;
  Serial.println(lfs_led);
  }
  
} 
if(rfs_button == HIGH)
{
  if(rfs_led == 0)
  {
    digitalWrite(rf_on, HIGH);
    digitalWrite(lf_on, LOW);
  rfs_led = 1;
  lfs_led = 0;
  }
  
}
radio.stopListening();
myData.Xposition = analogRead(joyStick_x);
myData.Yposition = analogRead(joyStick_y);
myData.Zposition = analogRead(joyStick_z);
myData.lf_select = lfs_led;
myData.rf_select = rfs_led;
Serial.println(myData.lf_select);

radio.write(&myData, sizeof(myData));

radio.startListening();

}

Receive

#include<Wire.h>
#include<Adafruit_PWMServoDriver.h>
#include<math.h>
#include<SPI.h>
#include<RF24.h>

RF24 radio (7,8);
byte addresses [] [10] = {"1Node", "2Node"};
int xJoystick;
int yJoystick;
int zJoystick;
int lf_button;
int rf_button;
struct dataStruct {

  int Xposition;
  int Yposition;
  int Zposition;
  int lf_select;
  int rf_select;
} myData;

Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();

int SERVOMIN = 150;
int SERVOMAX = 600;

int coxa = 56;
int femur = 40;
int tibia = 60;
int camber = 10;
float x;
float y;
float z;
float rf_x;
float rf_y;
float rf_z;
float lf_x;
float lf_y;
float lf_z;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  radio.begin();
  radio.setChannel(108);
  radio.setDataRate(RF24_250KBPS);
  radio.setPALevel(RF24_PA_LOW);
  radio.openWritingPipe(addresses[1]);
  radio.openReadingPipe(1, addresses[0]);
  radio.startListening();
  
pwm.begin();
Serial.begin(115200);
pwm.setPWMFreq(60);
yield();
}

void loop() {
  // put your main code here, to run repeatedly:
if (radio.available()){
  {

    while (radio.available())
    radio.read(&myData, sizeof(myData));
    
  }
}

xJoystick=myData.Xposition;
yJoystick=myData.Yposition;
zJoystick=myData.Zposition;
lf_button=myData.lf_select;
rf_button=myData.rf_select;
Serial.println(rf_button);
float xchange = map(xJoystick, 0, 1023, -4, 4);
float ychange = map(yJoystick, 0, 1023, -4, 4);
float zchange = map(zJoystick, 0, 1023, -4, 4);

if (lf_button == HIGH && rf_button == LOW) 
{
  x = lf_x; y = lf_y; z = lf_z;
}
if (rf_button == HIGH && lf_button == LOW)
{
  x = rf_x; y = rf_y; z = rf_z;
}
x = x + xchange; y = y + ychange; z = z + zchange;
float G = atan((x-12.5)/(y-41.5));
float D = sqrt (((x-12.5)*(x-12.5)) + ((y-41.5)*(y-41.5)));
float L = sqrt (((D-coxa)*(D-coxa))+(z*z));
float A = acos(((femur*femur)+(tibia*tibia)-(L*L))/(2*femur*tibia));
float B = (acos(((femur*femur)+(L*L)-(tibia*tibia))/(2*femur*L))+acos(((L*L)+(z*z)-((D-coxa)*(D-coxa)))/(2*L*z)));

G = degrees(G);
if (G<= 0) G = 180 + G;

A = degrees(A);
B = degrees(B);

if (lf_button == HIGH)
{
  G = map(G, -40,160,-20,180);
  G = map(G,0,180,150,600);
  A = map(A,180,0,150,600);
  B = map(B, 0, 180, 150, 600);
  pwm.setPWM(0,0,G);
  pwm.setPWM(1,0,B);
  pwm.setPWM(2,0,A);
  lf_x = x; lf_y=y; lf_z = z;
}
if (rf_button == HIGH)
{
  G = map(G, 0, 200, -20, 180);
  G = map(G, 0, 180, 150, 600);
  A = map(A, 0, 180, 150, 600);
  B = map(B, 180, 0, 150, 600);
  pwm.setPWM(3, 0, G);
  pwm.setPWM(4, 0, B);
  pwm.setPWM(5, 0, A);
  rf_x = x; rf_y = y; rf_z = z;
}

}

C:\Users\troy\Desktop\quadruped_servo_shield_attempt_start\joyrectest_2led\joyrectest_2led.ino: In function ‘void setup()’:

C:\Users\troy\Desktop\quadruped_servo_shield_attempt_start\joyrectest_2led\joyrectest_2led.ino:49:36: warning: invalid conversion from ‘byte* {aka unsigned char*}’ to ‘uint64_t {aka long long unsigned int}’ [-fpermissive]

radio.openWritingPipe(addresses[1]);

^

In file included from C:\Users\troy\Desktop\quadruped_servo_shield_attempt_start\joyrectest_2led\joyrectest_2led.ino:5:0:

C:\Users\troy\Documents\Arduino\libraries\RF24-master/RF24.h:324:8: note: initializing argument 1 of ‘void RF24::openWritingPipe(uint64_t)’

void openWritingPipe(uint64_t address);

^

C:\Users\troy\Desktop\quadruped_servo_shield_attempt_start\joyrectest_2led\joyrectest_2led.ino:50:39: warning: invalid conversion from ‘byte* {aka unsigned char*}’ to ‘uint64_t {aka long long unsigned int}’ [-fpermissive]

radio.openReadingPipe(1, addresses[0]);

^

In file included from C:\Users\troy\Desktop\quadruped_servo_shield_attempt_start\joyrectest_2led\joyrectest_2led.ino:5:0:

C:\Users\troy\Documents\Arduino\libraries\RF24-master/RF24.h:350:8: note: initializing argument 2 of ‘void RF24::openReadingPipe(uint8_t, uint64_t)’

void openReadingPipe(uint8_t number, uint64_t address);

^

Sketch uses 8658 bytes (26%) of program storage space. Maximum is 32256 bytes.
Global variables use 492 bytes (24%) of dynamic memory, leaving 1556 bytes for local variables. Maximum is 2048 bytes.

Use the correct (matching your copied code) library, it seems you are using the old original Maniacbug library.

TMRh20 2014 - Optimized Fork of NRF24L01+ Driver

I followed the link and replaced the library,, but I don't think it solved it. the problem remains. I'm 100% sure I've got the wires correct,, although I'll check them again,, but perhaps there is something about the shield I don't know, for example if any pins are being used (Actually the adafruit page says they only use the i2c pins,, none of which are occupied by the transceiver,, so I don't actually think that's a problem with my setup.

what I do get on the receiver side is nothing , until I wiggle the module and all the wires up to it,, it suddenly starts serial printing a stream of either 0 or -1,, and on some tries it would print a 1. It doesn't change from any form of input,, just randomly between 0 and -1. If I touch the pins on the module it might send a bunch of values for a minute. perhaps it's not actually transmitting at all?? but while the transmitter is hooked to the computer for serial monitor,, the monitor is fed a steady stream of values from the data structure, which do respond to input.

Whandall:
Use the correct (matching your copied code) library, it seems you are using the old original Maniacbug library.

TMRh20 2014 - Optimized Fork of NRF24L01+ Driver

tsmspace:
the problem remains.

No. With the new library your sketch compiles, with the old it doesn't.

You may have a different problem now, but not "the problem".

This Simple nRF24L01+ Tutorial may ne of interest.

...R