2

I would like to use these 2 components with an Arduino Uno:

  • Arduino Motor Shield R3
  • nRF24L01 2.4GHz Wireless Transceiver

I use Stepper for the motor shield, and SPI + RF24 for the wireless transceiver.

I could write 2 sketches that work perfectly, but how can I combine them together?

My issue is that they both require access to pins 11, 12 and 13.

Any help is greatly appreciated!

  • You can't really. You could use Channel A, if you disable the motor (keep D3 low), while performing your SPI communication. I think, but am not sure, you can use both channels if you enable the break (D9 and D8) while using SPI. But you can't have any motors running while using SPI. (BTW the person that designed that shield should be fired for using the SPI pins. That's just bonkers) – Gerben Aug 22 '14 at 19:58
2

This is the core of embedded design and "hacking" and highlights one of my peeves about Arduino design: too much focus on the pin numbers and physical location on the PCBs, rather than the actual functions on those pins.

So? Physically move the pins on the Motor Shield. Here are 3 options in order of the most hack-ish to most-clean:

1) Use an edge cutter to cut the bottom of the pins off the motor shield then solder jumpers to the nub to other pins that are free.

2) Use a hot air station to desolder that header row, solder in your jumpers, and put back only the pins you want. Board designs with such limited foresight (like your situation) is what led me to buy my hot air station. And now I pretty much use sensor shields for my interfacing outside the stack or proto shields to be intermediate layers to translate pins.

3) Cut the trace on the motor shield PCB itself to free the SPI pins. Then find pins that have your function (pwm?) and also are NOT used by any other shields in your "stack". Solder a jumper from the exposed trace on SPI pins to your free "new" pins.

If you stalk through my answers there are write-ups on two test benches I made and you can get ideas from the various work-arounds I have employed to get my hardware working.

0

For prototyping, use male to female jumper wires to connect the Arduino Uno to the robot shield. It is a bit of a pain, but it makes it easy to free the conflicting pins for the wireless transceiver.

For a more permanent solution, look at Chris K's answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.