You are on page 1of 1

#include<avr/io.

h>
#include <util/delay.h>
int main(void)
{
PORTC=0x0F;
PORTB=0x01;
PORTD=0x50;
while(1)
{
if((PINC & 0x01)==0)
{
DDRB=0x03;
PORTB=~PORTB;
while((PINC & 0x01)==0);
DDRB=0x00;
}
if((PINC & 0x02)==0)
{
DDRD=0x30;
PORTD=~PORTD;
while((PINC & 0x02)==0);
DDRD=0x00;
}
if((PINC & 0x04)==0)
{
DDRD=0xC0;
PORTD=~PORTD;
while((PINC & 0x04)==0);
DDRD=0x00;
}
_delay_ms(100);
}
}

You might also like