Arduino pins

i am using Arduino Uno right now , and running out of digital pins , for other reasons i can’t alter to ATmega at this moment , my question is can PWM pins be used as ordenary digital pins ? , and I heard that Analog input pins can be used with some sort of tricky programming to do the job of Digital pins as well , is that true ? and if true what would be the code ? (sorry to ask for codes in here :cold_sweat: )
thanks for all who would help , and for all who don’t ;D

PWM pins are digital pins. Analog pins A0 is same as D14 etc to D19 for A5.

"LarryD "thanks dude really appreciate your help , :)

I recommend using the names A0 through A5 even though you are using them as digital pins. If you use numbers (14-19) that will fail in a Leonardo where the analog pin numbers start at 18 and on a MEGA where the analog pins are up in the 50's!

Also note that on surface-mount ATmega328P models that have A6 and A7 pins your CAN'T use those as digital pins. They are only extra inputs to the A/D multiplexer and don't have the digital hardware.