My Arduino nano make weired thing... The TX LED is on when i define a Variable and a digital Pin as output. Do you now if it is a error in the code? If I upload a clear new sketch the LED is off.



int ok = 1;
int err = 0;
int x1 = 2;
int x2 = 3;
int x3 = 4;
int x4 = 5;
int x5 = 6;
int x6 = 7;
int y1 = 8;
int y2 = 9;
int y3 = 10;
int y4 = 11;
int y5 = 12;
int y6 = 13;
int value1 = digitalRead(14);
int value2 = digitalRead(15);
int value3 = digitalRead(16);
int test = digitalRead(17);

void setup() {
  pinMode(0, OUTPUT);
  pinMode(1, OUTPUT);
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(7, OUTPUT);
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(12, OUTPUT);
  pinMode(13, OUTPUT);
  pinMode(14, INPUT);
  pinMode(15, INPUT);
  pinMode(16, INPUT);
  pinMode(17, INPUT);

void loop() {
  // put your main code here, to run repeatedly:


1 Answer 1


You configure serial pins as output, this may be your issue.

enter image description here

also, you're calling some digitalRead() before setup call, you would have to do that in the loop.

  • I tried some things to the pins and i foud something very interessting out. The value to be activated must be LOW instead of HIGH. That means that the TX and RX pins can be used as a normal digital pin but the activation value is inverted. I made a short video where I tested it. It is unlisted on YouTube: link ~Nico
    – Nico L.
    Mar 18, 2017 at 21:54
  • So... My decision was WRONG. The LED's in the Arduino are on if the pins are off. If the pins are on the LED's are off. For some reason the RX pin is on if you made him to an digital output. Would be awesome if some other people test it too to check if it is only for me or if it in a error of the Arduino Nano. ~Nico
    – Nico L.
    Mar 18, 2017 at 23:41
  • Both RX & TX pins are driving the onboard LEDs when set to LOW. Those 2 pins are tied to FT232RL chip to convert serial signal for USB. This may be the reason they are reacting to inverted logic. If you can avoid using these 2 pins, it would be better. you could also reflash the nano without disconnecting it from your own electronic parts for those 2 pins (reflashing may not work depending on what is connected on these pins).
    – SMFSW
    Mar 19, 2017 at 10:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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