We are working on a project in which we want a few arduino's (uno's and nano's) to communicate with a mega. We are using the RF24 library. Communication between uno and nano is working well. When we use the mega it doesn't work. We changed the initializing from
RF24 radio(9,10);
in
RF24 radio(9,53);
because of the different pins on a mega. Instead of waiting with opening like on the uno or nano the mega returns imidiatly. Of course we used the correct SPI pins on the mega.
aisc:
I would say u made the connections to the correct pins on the mega but remember the library has the pins defined to match an uno et al and not a mega.
You redefined 2 pins, but there are 4 more if u consider IRQ.
So u need to redefine the other 4 pins to match your mega connections.
I don't think this is correct.
I have used these NRF24L01+ modules on an Uno a Nano and a Mega.
At no time I have needed to edit a library to get them to work. It is possible other RF24 libraries work differently. I have been using the tmrh20 library off github for this.
It seems the SPI library knows which pins are MISO MOSI and SCK per board selected in the Arduino IDE.
The user simply has to use the proper pins per device.
Which for Uno/Nano are MOSI-11 MISO-12 and SCK-13.
Mega is MISO-50 MOSI-51 and SCK-52.
Actually on all 3 devices I use D9 for CE and D10 for CSN/SS as well. That way when trying the various examples in the RF24 library I don't have to change any of the sketch variables. Just plug in the device, change the board/port settings under tools in the IDE and upload.