connect a button to pin 0 or 1

Can i connect a button to pin 0 or 1 in the arduino ?

i know that these 2 pins are for serial communication and that i can't use them in digital i/o " digital read and write "

when i made a simulation of the code on Proteus , the button did work perfectly though it was connected to pin 0 and 1

i am in a desperate need to these 2 pins to complete the project

so if it is not going to work with the button , can i reuse them to connect a led or lcd for example ?

Buttons will be OK. The pins are just ordinary pins until you call Serial.begin().
It is even possible to let the Arduino bootloader do its work, the serial pins are released after that. Of course you must not push the buttons while data is being transmitted.

olf2012:
Buttons will be OK. The pins are just ordinary pins until you call Serial.begin().
It is even possible to let the Arduino bootloader do its work, the serial pins are released after that. Of course you must not push the buttons while data is being transmitted.

Words can't thank you enough
i was afraid i was going to need to use a shift register or demultiplexer to increase the no. of pins , and i have no time for them right now
Mille merci :slight_smile: