In this blog and on my Youtube channel, I presented some projects to control a model railway with Arduino.
I chose to use the Loconet communication bus, leveraging the library MRRWA made available for Arduino.
This library allows, in the init() method, to configure which transmission pin should be used, but the receiving pin is fixed.
For Arduino Uno, that PIN is PIN8.
While I was working on a project with an Arduino Pro Micro (ATMEGA32U4 chip) I asked myself which PIN I should use…
If you open the ln_config.h file, you can find the #define lines for the different boards:
For the chip I’m using, I have to use PORTD4.
From the board schematics I can find that this PIN corresponds to PIN 4:
What I explained above, can be used to identify the correct RX PIN for every board/chip the library supports.