Pins used for LCD connections

Greetings!

Is there a reason why the pins on the Arduino (Uno) always seem to be the same when attaching an LCD (16 x 2 or (in my case) 20 x 4)?
"LiquidCrystal lcd(12, 11, 5, 4, 3, 2);"

Can the pins of the LCD be attached to ANY of the Arduino pins, or those ones specifically?

If they DO need to be attached to those pins, specifically, why? And what would be the equivalent pins to attach them to an Arduino Mega?

Thank you in advance for the help and advice, and have a better day!

What happened when you tried different pins?

I'll be honest, I have not tried to connect it to other pins. Having always seen it written this way, I just assumed (I know ... NEVER Assume!) that they had to be connected to those pins.

There is nothing special about those pins, though I would certainly avoid the SPI pins, if I wanted to use them for SPI devices.

You can use any available I/O pin, that includes the so called 'analog' pins, on the Arduino to drive any of the pins on the LCD.

Typically you figure out which other devices that you are using require certain pins, such as any SPI devices as mentioned previously. After you have all those assigned you figure out which ones are unused and select six of those pin for your LCD.

You use the constructor, which the LiquidCrystal lcd(. . .); statement, to inform the library which pins you have selected.

Don