any help please ! thanks in advance
i tried all the wiring ways that i found when searching for solution , and it didn't work !
it works with the arduino uno perfectly !
but with leonardo board it didn't !
for arduino uno i use the spi (11 12 13) ! and 8/9 for CE/CSN :!
and for leonardo i use the method above and it didn't work , i also use the ICSP headers to connect the MISO MOSI SCLK and also it didn't work ! the arduino doesn't receive nothing !
i also use the ICSP headers to connect the MISO MOSI SCLK
Which pins did you use ?
Should be 4, 1, and 3 (MOSI, MISO, SCK)
How about posting your code ?
thanks for your reply !
i use like in this picture !
and here is my code . it works well for arduino uno ! the uno receives the data and print it to serial !
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8); // nRF24L01 (CE, CSN)
const byte address[6] = "00001"; // the sme address for the transmitter
struct Data_Package {
byte jaxisX;
byte jaxisY;
byte jButton;
byte button1;
byte button2;
byte button3;
byte button4;
byte button5;
byte button6;
};
Data_Package data;
void setup() {
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(0, address);
radio.setAutoAck(false);
radio.setDataRate(RF24_250KBPS);
radio.setPALevel(RF24_PA_LOW);
radio.startListening(); // Set the module as receiver
// resetData();
}
void loop() {
if (radio.available()) {
radio.read(&data, sizeof(Data_Package)); // Read the whole data and store it into the 'data' structure
// Print the data in the Serial Monitor
Serial.print("data.jaxisX ");
Serial.println(data.jaxisX);
Serial.print("data.jaxisY ");
Serial.println(data.jaxisY);
Serial.print("data.jButton ");
Serial.println(data.jButton);
Serial.print("data.button1 ");
Serial.println(data.button1);
Serial.print("data.button2 ");
Serial.println(data.button2);
Serial.print("data.button3 ");
Serial.println(data.button3);
Serial.print("data.button4 ");
Serial.println(data.button4);
Serial.print("data.button5 ");
Serial.println(data.button5);
Serial.print("data.button6 ");
Serial.println(data.button6);
Serial.println("*************************");
delay(500);// to easly read the data in serial monitor
}