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?

c_breeez
  • 349
  • 1
  • 3
  • 9

3 Answers3

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.

jfpoilpret
  • 8,962
  • 6
  • 35
  • 53
3

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

sdcharle
  • 121
  • 1
  • 3
-1

You can, but it will disable the serial port.

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