Hi..
I am trying to get input from a button using the following code but its not work, it should be something simple, avr studio does not give any error
DDRD = 0b00001111 //only port 5,6,7 as input and other for different purpose
PORTD = 0b01110000 //enabling pull up resistor
main
while(1)
if(pind5 == 0) //detecting input from button
{
some function here like turn on leds
}
Physical connections in breadboard: ATMEGA8--pin7 vcc, pin8 ground, pin 11,12,13 to push button which is connected to ground, other pins to leds.