NRF24L01 and Ethernet Shield

Look at how that code is used. It's not defining pin numbers, just the state of the testing module. (Receive mode or Transmit mode.) That module is not meant to do both at once.

Let's see if I have understood the description in Reply #18 ...

It seems to me you have ArduinoA that operates a light after receiving a command by wireless (nRF24).

And you have an ArduinoB (a Mega) that has some sensor attached and depending on the output of the sensor it sends a wireless command to ArduinoA.

Then you added an Ethernet shield to ArduinoB because you want it to be able to receive a network command to tell it to send a wireless message to ArduinoA.

At the moment you have a pair of programs for ArduinoA and ArduinoB (without Ethernet) that work together to control the light.

And you also have a non-wireless program for ArduinoB which can receive network messages and which turns on and off an LED on ArduinoB.

But when you try to make a combined wireless and ethernet program on ArduinoB the light is not being controlled.

IMHO to make progress the following few things are needed.

FIRST ... the pair of programs that are on ArduinoB and ArduinoA when the wireless works
SECOND ... the program on ArduinoB that can trigger the LED when a network message is received
THIRD... an example of the network message that is received by ArduinoB when the LED works
FOURTH ... the program for ArduinoB that attempts to combine the network and wireless behaviour
FIFTH ... a sample of the output from ArduinoB when you run it.

If you have already posted the code for any of those parts in an earlier Post it will be sufficient just to say which Reply contained it. However it is essential that the code is EXACTLY what was used.

...R

I think I found my problem. :o

SPI is not on pins 11, 12, and 13 on the Arduino Mega. The Mega uses the ICSP pins for SPI so if you want to add another SPI device you have to connect to the ICSP pins or I believe there is a SoftSPI library that will allow you to assign pins to create another SPI bus.

Going to try a direct connection to the ICSP pins. I'll let you know if it works.

...or I guess I could try the actual SPI pins on the Mega...pins 50, 51, and 52.

Well this is embarrassing. I guess it help to use the right pins! At long last my project is working, yay!

@Robin Thanks for all your help!

kengel:
Well this is embarrassing. I guess it help to use the right pins! At long last my project is working, yay!

@Robin Thanks for all your help!

An easy mistake. Glad it's now working.

...R