fatal error: RF24: No such file or directory

Hi, I am having a problem coding my Arduino Uno.

This is what pops up when I try to verify my code.

Users/Jackie/Desktop/Arduino_wireless_glove/Arduino_wireless_glove.ino:9:92: fatal error: RF24: No such file or directory
#include “RF24” //the library which helps us to control the radio modem
^
compilation terminated.
exit status 1
Error compiling for board Arduino/Genuino Uno.
[/color]

Here is my code:

#include <SPI.h> //the communication interface with the modem
#include “RF24” //the library which helps us to control the radio modem

int msg[1];

//define the flex sensor input pins
int flex_5 = A5;
int flex_4 = A4;
int flex_3 = A3;
int flex_2 = A2;
int flex_1 = A1;

//define variables for flex sensor values
int flex_5_val;
int flex_4_val;
int flex_3_val;
int flex_2_val;
int flex_1_val;

RF24 radio(5,10); //5 and 10 are a digital pin numbers to which signals CE and CSN are connected.

const uint64_t pipe = 0xE8E8F0F0E1LL; //the address of the modem, that will receive data from Arduino.

void setup(void){
Serial.begin(9600);
radio.begin(); //it activates the modem.
radio.openWritingPipe(pipe); //sets the address of the receiver to which the program will send data.
}

void loop(){

flex_5_val = analogRead(flex_5);
//175 - 0
flex_5_val = map(flex_5_val, 1023, 0, 0, 10);
msg[0] = flex_5_val;
radio.write(msg, 1);

flex_4_val = analogRead(flex_4);
//175 - 0
flex_4_val = map(flex_4_val, 1023, 0, 11, 20);
msg[0] = flex_4_val;
radio.write(msg, 1);

flex_3_val = analogRead(flex_3);
//175 - 0
flex_3_val = map(flex_3_val, 1023, 0, 21, 30);
msg[0] = flex_3_val;
radio.write(msg, 1);

flex_2_val = analogRead(flex_2);
//175 - 0
flex_2_val = map(flex_2_val, 1023, 0, 31, 40);
msg[0] = flex_2_val;
radio.write(msg, 1);

flex_1_val = analogRead(flex_1);
//175 - 0
flex_1_val = map(flex_1_val, 1023, 0, 41, 50);
msg[0] = flex_1_val;
radio.write(msg, 1);
}

Please give some feedback, THANKS. :slight_smile:

1) Start your own threads, don't tail end some random thread that has nothing to do with your problem. 2) Did you install the library properly? 3) Learn to use code tags.

This

#include "RF24"                     //the library which helps us to control the radio modem

is probably supposed to be

#include "RF24.h"                     //the library which helps us to control the radio modem

Notice the addition of ".h".

good catch… or possibly

#include <RF24.h>

Any thing else I already tried those.

Hi, Did you get a new compiling error with updated code?

Tom... :)

Thread split.

Jackiet: Any thing else I already tried those.

Did you download the RF24 library from the github website?

...and did you install it properly according to the documentation?

@Jackiet this Simple nRF24L01+ Tutorial should help get you started.

Get your wireless communication working reliably before you try to add any other code into the project as the wireless stuff can be hard to debug.

...R

Hi,
This is your code with RF24.h taken care of, it compiles on WIN7, IDE 1.8.3

#include <SPI.h>                      //the communication interface with the modem
#include "RF24.h"                     //the library which helps us to control the radio modem

int msg[1];

//define the flex sensor input pins
int flex_5 = A5;
int flex_4 = A4;
int flex_3 = A3;
int flex_2 = A2;
int flex_1 = A1;

//define variables for flex sensor values
int flex_5_val;
int flex_4_val;
int flex_3_val;
int flex_2_val;
int flex_1_val;

RF24 radio(5,10);                     //5 and 10 are a digital pin numbers to which signals CE and CSN are connected.
                                      
const uint64_t pipe = 0xE8E8F0F0E1LL; //the address of the modem, that will receive data from Arduino.


void setup(void){
  Serial.begin(9600);
  radio.begin();                      //it activates the modem.
  radio.openWritingPipe(pipe);        //sets the address of the receiver to which the program will send data.
}

void loop(){

  flex_5_val = analogRead(flex_5); 
                             //175 - 0
  flex_5_val = map(flex_5_val, 1023, 0, 0, 10);
  msg[0] = flex_5_val;
  radio.write(msg, 1);

  flex_4_val = analogRead(flex_4);
                             //175 - 0
  flex_4_val = map(flex_4_val, 1023, 0, 11, 20);
  msg[0] = flex_4_val;
  radio.write(msg, 1);

  flex_3_val = analogRead(flex_3);
                             //175 - 0
  flex_3_val = map(flex_3_val, 1023, 0, 21, 30);
  msg[0] = flex_3_val;
  radio.write(msg, 1);

  flex_2_val = analogRead(flex_2);
                             //175 - 0
  flex_2_val = map(flex_2_val, 1023, 0, 31, 40);
  msg[0] = flex_2_val;
  radio.write(msg, 1);

  flex_1_val = analogRead(flex_1);
                             //175 - 0
  flex_1_val = map(flex_1_val, 1023, 0, 41, 50);
  msg[0] = flex_1_val;
  radio.write(msg, 1);
}

If it doesn’t compile for you, you must have not installed the RF24 library in the correct location.

Tom… :slight_smile: