#define F_CPU 4000000UL

#include <avr/io.h>
#include <util/delay.h>

unsigned int i =0;
 
void villog1() {
					for(i=0;i<11;i++) {
										PORTD = ~PORTD;
										_delay_ms(1000);
									  }
			   }

void villog2() {
					for(i=0;i<11;i++) {
										if(!(PINB & _BV(PB1))) {
																	PORTB = (1<<PB2);
															   }

										else {						PORTB = ~(1<<PB2);
										_delay_ms(1000);
									  }
			   }

int main(void) {

DDRB  = 0xFF;
PORTB = 0x01;

DDRC  = 0x00;
PORTC = 0xFF;

DDRD  = 0xFF;
PORTD = 0x00;

	for(;;) {

				if(!(PINC & _BV(PC1))) villog1();
				if(!(PINC & _BV(PC2))) villog2();

	_delay_ms(100);

}
}
