RF24 and PWM on pins D9 and D10

Hey everyone,

I'm having an issue where my code is able to get messages correctly from an nrf24l01, but I can't use pins D9 and D10.

  • Arduino Nano
  • I'm using A2 and A3 for CE and CSN.
  • I can get messages without any problems, but I can't seem to be able to use D9 and D10
  • D9 and D10 work perfectly when not using RF24.

Any ideas would be appreciated!

Thanks

You don't need to use pins 9 and 10 for the nRF24 - you can use any other pins. However for SPI to work pin 10 must be set as OUTPUT even if it is not being used for SPI. I think that requirement will be satisfied if you use pin 10 for analogWrite().

...R Simple nRF24L01+ Tutorial

Hi Robin2, yes, read your tutorial, it was very helpful. Thanks for writing it!

However, I can’t seem to find an answer to my problem.

D10 is explicitly set to an output, yes. However, I can’t use it nor D9 while rf24 is initiated. I need both D9 and D10 for PWM in my project.

egaralmeida: However, I can’t use it nor D9 while rf24 is initiated. I need both D9 and D10 for PWM in my project.

Please post your program and describe in detail what happens when your run it and what you want it to do that is different.

...R

egaralmeida: D10 is explicitly set to an output, yes. However, I can’t use it nor D9 while rf24 is initiated. I need both D9 and D10 for PWM in my project.

It works for me with a Nano.

Just recently installed a soft starting PIR and radar controlled illumination for my attic that uses PWM on 10, 9, 6, 5 and 3 and a NRF24L01 for reports and configuration.

Works like a charm.