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?
Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. It only takes a minute to sign up.
Sign up to join this communityThe 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?
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.
Also you will probably want to ensure these wires are not connected when programming the Arduino. Otherwise you may have problems.
You can, but it will disable the serial port.
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