Arduino Mega - Communication Pin as INPUT or OUTPUT

Hello Friends !!

I making a project where i use a lot of INPUT and OUTPUT pins from Arduino Mega.
I would like to know if can i use the Communication Pins as INPUT or OUTPUT?

I talking about Pins from 14 to 21, i'm not using Pins 0 and 1

If i use 0 and 1 then the Serial.print doesn't work properly, that's why i'm not using them. But what about the rest of Communication Pins (14 - 21).

Can i use them as Digital OUTPUT or INPUT without problem?

Thank you !!

:grin:

Can i use them as Digital OUTPUT or INPUT without problem?

You have out permission. Whether you have problems, or not, depends on what you want to connect to the pins.

Hello, Thank you for your answer !! :smiley:

For INPUT i will connect a resistense to ground and a button to sent 5v when i push it

For OUTPUT i will activate a 5v Relay

By the way, i'm using the Serial.print to see some information in my PC's the screen.
The problem here is when i use Pin 0 and 1 from communication because i'm using the Serial port, i can't use Pins 0 and 1 as INPUT/OUTPUT if i'm using the Serial Port at the same time.

The question here is: If i use the others TX and RX as INPUT/OUTPUT, will i have problems with the Serial comunication to the PC's screen?

Thank you !! :grin:

If i use the others TX and RX as INPUT/OUTPUT, will i have problems with the Serial comunication to the PC's screen?

No, you won't. The RX and TX pins have resistors included in the circuitry that can present challenges when using them as input pins. I don't recall, and am too lazy to search, whether the RX1, RX2, RX3, TX1, TX2 and/or TX3 pins have the resistors, too.

Thank you PaulS 8)

I will make the circuit.

See you later !! :smiley: