LED on button push ATMEGA328p
The problem is in the code that detects a button press. You wrote:

if( (PORTD &amp; (1&lt;&lt;PD0)) )


However, you should write this instead:

if(PIND &amp; (1 &lt;&lt; PD0))


This is because PORTD is the output register. It will only reflect values that you write to the pin, not an external voltage. PIND is the input register, which reflects the voltage read at the pin.

And as brhans pointed out, PORTC |= ~(1 &lt;&lt; PC0); should be PORTC &amp;= ~(1 &lt;&lt; PC0); instead.