Compass Only Works on Pins 10 and 11 – Arduino/Software Serial

Hey everyone,

A bit of a confusing issue I ran into today. I couldn’t get my compass to work on any pins other than 10 or 11. Thankfully, there’s a fairly logical explanation:

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, 14, 15, 50, 51, 52, 53, A8 (62), A9 (63), A10 (64), A11 (65), A12 (66), A13 (67), A14 (68), A15 (69).

I ended up using pins 50 and 51 and it all worked fine. See the following links for more info:
https://www.arduino.cc/en/Reference/softwareSerial
https://arduino.stackexchange.com/a/35719/37451

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s