1

As soon as I include keyboard.h my pro micros LED starts flashing (as far as I know this indicates a serial connection is stablished or so.)

But it's really annoying having a flashing led on my desk all the time.

Is there an option to disable this 'debugging' behaviour from the keyboard.h libary?

pqzpkaot
  • 115
  • 3

2 Answers2

1

Those LEDs are controlled by the USB Core code, and are defined in the board variant. For the pro micro that's the pins_arduino.h file in the micro variant:

#define TXLED0          PORTD &= ~(1<<5)
#define TXLED1          PORTD |= (1<<5)
#define RXLED0          PORTB &= ~(1<<0)
#define RXLED1          PORTB |= (1<<0)
#define TX_RX_LED_INIT  DDRD |= (1<<5), DDRB |= (1<<0), TXLED0, RXLED0

If you edit that file and remove everything after the macro name, so you have 5 empty macros, it should disable the LEDs completely.

#define TXLED0
#define TXLED1
#define RXLED0
#define RXLED1
#define TX_RX_LED_INIT

Edit:
For the Sparkfun Pro Micro, edit the file at

...\AppData\Local\Arduino15\packages\SparkFun\hardware\avr\1.1.13\variants\promicro

This is because it has an extra package that is not installed by default.

sa_leinad
  • 3,218
  • 2
  • 23
  • 51
Majenko
  • 105,851
  • 5
  • 82
  • 139
1

it's really annoying having a flashing led on my desk all the time.

As a software engineer I know we often fall into the trap of thinking that all problems must have a software solution. Try thinking of this as a hardware problem.

  • Cut out a small piece of a sticky label and stick it over that annoying LED.
  • Use a soldering iron to remove the offending LED.
  • Use needle-nosed pliers to crush the offending LED.

The more destructive solutions can be reversed with a soldering iron and maybe a new SMD LED. For Arduinos with female or stacking headers you could instead reinstate the feature by plugging a thru-hole LED and resistor into the appropriate positions in the Arduino's header sockets. E.g. D13 and GND. For other Arduinos by adding LED and resistor in adjacent positions in a breadboard.

There might be a good software solution but it can be worth considering other approaches.

RedGrittyBrick
  • 1,192
  • 6
  • 14