Using AltSoftSerial with Pro Micro / Leonardo Mini Micro Clones w/ATmega32U4 MU

This isn't really documented, and I just thought I would share this. Doing some Googling, I've seen a few people talk about this, but no responses. The problem is there is no pin 13 on the Pro Micro since although it is using a ATmega32U4, it's the scaled down MU version, not the AU version that's on the Leonardo.

You can use Pin 4 for RX by making the following changes in AltSoftSerial_Boards.h, assuming you aren't using anything or any libraries that use timer1.

Change this:

#elif defined(ARDUINO_AVR_YUN) || defined(ARDUINO_AVR_LEONARDO) || defined(__AVR_ATmega32U4__)

  //#define ALTSS_USE_TIMER1
  //#define INPUT_CAPTURE_PIN		4  // receive
  //#define OUTPUT_COMPARE_A_PIN	9 // transmit
  //#define OUTPUT_COMPARE_B_PIN	10 // unusable PWM
  //#define OUTPUT_COMPARE_C_PIN	11 // unusable PWM

  #define ALTSS_USE_TIMER3
  #define INPUT_CAPTURE_PIN		13 // receive
  #define OUTPUT_COMPARE_A_PIN		5 // transmit

to this:

#elif defined(ARDUINO_AVR_YUN) || defined(ARDUINO_AVR_LEONARDO) || defined(__AVR_ATmega32U4__)

  #define ALTSS_USE_TIMER1
  #define INPUT_CAPTURE_PIN		4  // receive
  //#define OUTPUT_COMPARE_A_PIN	9 // transmit
  //#define OUTPUT_COMPARE_B_PIN	10 // unusable PWM
  //#define OUTPUT_COMPARE_C_PIN	11 // unusable PWM

  //#define ALTSS_USE_TIMER3
  //#define INPUT_CAPTURE_PIN		13 // receive
  #define OUTPUT_COMPARE_A_PIN		5 // transmit

Thanks for this post. It was very helpful.

I ended up using (uncommenting) both the 4 rx and 9 tx under timer1, and commenting out the 13rx and 5 tx under Timer3.

It seems to work, but is there any reason not to do it this way?