21

ноя

Are you running afoul of any of the restrictions of Software Serial? • If using multiple software serial ports, only one can receive data at a time. • Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69 • Not all pins on the Leonardo support change interrupts, so only the following can be used for RX: 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI). Given that you're using the shields, you'd have trouble with my favorite trick.

Sometimes, one serial port just isn't enough! When trying to communicate with multiple serial enabled devices, while also sending info back to the main serial window, a few extra RX/TX ports can be a welcomed thing.

Arduino Multiple Software Serial Ports Pictures

I've occasionally used relays, analog multiplexers, or transistors to switch the functionality of pins on-the-fly. By using one digital pin to select which serial device you want to talk to, you can have both of your communication pipelines taking place on pins 0 and 1. However, that's not an option with off-the-shelf shields. Powerdesigner