15

The uno has digital pins marked 0-13.

0 is marked as rx and 1 is marked as tx. Can these two pins be used as regular digital pins if i am short of digital pins?

1
  • If you are short of digital pins you can aways use the analog pins. They also work as digital pins. May 15, 2018 at 15:44

3 Answers 3

11

Yes you can perfectly use these 2 pins as long as your program does not use Serial.

EDIT: Serial data over USB goes through copper traces connected to the rx and tx pins, connecting them to the USB to serial converter chip.

3
  • My program is using serial, but pumping it through the usb. Not out of the rxtx pins. Is this still a problem?
    – c_breeez
    Aug 13, 2014 at 20:37
  • 4
    It is the same: USB data is passing through RX/TX pins :-(
    – jfpoilpret
    Aug 13, 2014 at 20:39
  • Ok thanks for your great answer and clarifying these points
    – c_breeez
    Aug 13, 2014 at 21:06
3

Also you will probably want to ensure these wires are not connected when programming the Arduino. Otherwise you may have problems.

-1

You can, but it will disable the serial port.

1
  • 1
    No, it's the other way around: the serial port has higher priority. When you enable it with Serial.begin(), you are disabling the normal port operation (pinMode(), digitalRead() and digitalWrite()). With one exception: you can set the RX pin to INPUT_PULLUP, rather than INPUT, which is the default. C.f. the datasheet of the ATmega328P, especially the sections Alternate Port Functions, Data Transmission – The USART Transmitter and Data Reception – The USART Receiver. May 14, 2018 at 7:57

Your Answer

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

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