interfacing NRF24L01+ and Leonardo !
-
hi . Please Help a newbie !
i have a problem with interfacing the NRF24L01+ module with Arduino Leonardo board !
this nrf module works well with arduino UNO . the arduino can receive and send data ! ( MISO 12 , MOSI 11, SCK 13 )
i tried different wiring methods . i tried like the UNO using the 11 12 13 digital pins of the leonardo , and didn't work .
i also use the ICSP headers to connect the MOSI MISO SCK and it didn't work !
CE/CSN to 9/10 , i also tried 8/10 ! nothing happened . the leonardo doesn't receive nothing !here is the code for the receiver board ( leonardo)
#include <SPI.h> #include <nRF24L01.h> #include <RF24.h> RF24 radio(9, 10); // nRF24L01 (CE, CSN) const byte address[6] = "00001"; 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 } void loop() { if (radio.available()) { radio.read(&data, sizeof(Data_Package)); 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 } }and i use the wiring in this pic and the same module

-
You don't seem to be using MySensors?
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login