Technology

PUSH BUTTON USE IN ATmel Studio

Posted On
Posted By Shivam Bharadwaj

Push button is basically a small controlling device that is pressed to operate any electrical device.

Contents
1 Circuit Diagram
2 Program(CODE TO CONTROL THE BLINKING OF LED VIA PUSH BUTTON)

int main(void)
{
DDRC |= (1<<PC0);

DDRD &= ~(1<<PD0);

while(1) //infinite loop
{
if(PIND & (1<<PD0) == 1)
{
PORTC |= (1<<PC0);
_delay_ms(3000);
PORTC &= ~(1<<PC0);
}
}
}

Related Post

leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.