Skip to content

Instantly share code, notes, and snippets.

@w4ilun
Last active August 19, 2020 17:50
Show Gist options
  • Save w4ilun/b6cffa1a478d233073b6 to your computer and use it in GitHub Desktop.
Save w4ilun/b6cffa1a478d233073b6 to your computer and use it in GitHub Desktop.
Using the TX/RX LEDs as extra pins on the Pro Micro
The TX/RX LEDs on the Pro Micro uses the pins PD5 and PB0.
You can remove the resistors and use these pins, but you will need to first redefine the TXLED/RXLED pins.
In OS X:
/Users/USERNAME/Library/Arduino15/packages/SparkFun/hardware/avr/1.1.3/variants/promicro/pins_arduino.h
Change these values:
#define TX_RX_LED_INIT DDRD |= (1<<5), DDRB |= (1<<0)
#define TXLED0 PORTD |= (1<<5)
#define TXLED1 PORTD &= ~(1<<5)
#define RXLED0 PORTB |= (1<<0)
#define RXLED1 PORTB &= ~(1<<0)
To:
#define TX_RX_LED_INIT DDRD |= (1<<6), DDRF |= (1<<0)
#define TXLED0 PORTD |= (1<<6)
#define TXLED1 PORTD &= ~(1<<6)
#define RXLED0 PORTF |= (1<<0)
#define RXLED1 PORTF &= ~(1<<0)
* Now using PD6 for TX and PF0 for RX, but it can be any other pin not being used
Or:
#define TX_RX_LED_INIT DDRD |= (1<<5), DDRB |= (1<<0)
#define TXLED0 1
#define TXLED1 1
#define RXLED0 1
#define RXLED1 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment