I made this program to turn on some lights on PORTC on mY Atmega8535.There's a button on PORTD, pin4 (counting from 0), but it has no effect when I press it.Can you help me please? thank you.
(i'm using programmers notepad)
#include
#include
int main(void)
{
DDRC = 0xFF;
PORTC = 0x00;
DDRD = 0x00;
PORTD = 0xFF;
while(1)
{
if ((PIND & 0x0F))
{
PORTC = ~PORTC;
}
}
return(0);
}