12

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?

  • If you are short of digital pins you can aways use the analog pins. They also work as digital pins. – Mikael Patel May 15 '18 at 15:44
9

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.

  • 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 '14 at 20:37
  • 4
    It is the same: USB data is passing through RX/TX pins :-( – jfpoilpret Aug 13 '14 at 20:39
  • Ok thanks for your great answer and clarifying these points – c_breeez Aug 13 '14 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.

  • 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. – Edgar Bonet May 14 '18 at 7:57

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.