arduino leonardo TXLED as output

dear Forum users

I want to use the leonardo's TXLED as an output

is there a example on how to do it?

because when i do TXLED0; i get the folowing error's
C:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\leonardo/pins_arduino.h:95:18: error: expected ')' before 'volatile'
#define TXLED0 PORTD |= (1<<5)
^
C:\Users\User\Documents\kicad projecten\mobile camera boards\updateSoftware\updated_software\updated_software.ino:33:1: note: in expansion of macro 'TXLED0'
TXLED0;//mosfet2
^~~~~~
and doe you know what causes this or?

Thanks in advance and with best regards Ben

The RX and TX led can be turned on in a normal way and they can be turned off by making the pins INPUT.
However, when the pins are OUTPUT and they are on, then they will be turned off and on when there is serial data.

See: Tx and Rx LEDs on a Pro Micro clone? - Programming Questions - Arduino Forum.

The macros are here: ArduinoCore-avr/pins_arduino.h at master · arduino/ArduinoCore-avr · GitHub.
Perhaps you use them in the sketch in combination with other code that does not work. Please show your sketch.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.