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?

2 Answers 2

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.

3
  • Didn't work for me. I even deleted them completly, but no error nothing. Maybe I am in the wrong directory or do I need to recompile something? Do I need to change it at some different place since the pro micro needs extra libaries to function anyways? The full path I used : C:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\micro\pins_arduino.h Dec 22, 2021 at 20:50
  • If you had to install more boards packages (I have not used that board) then the file will be in that package somewhere.
    – Majenko
    Dec 22, 2021 at 23:26
  • Works now :D. If anybody is interested: The file you need to edit is at ...\AppData\Local\Arduino15\packages\SparkFun\hardware\avr\1.1.13\variants\promicro It's a bunch of stuff in the file. You need to look for a second to find the keywords but they are there. Dec 23, 2021 at 12:22
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.