#include #include void main() { void delay(); DDRC = 0x00; while (1) { if (PORTC & 0x01) { PORTB= 0xFF; printf("\npattern 1"); delay(); PORTB= 0x00; printf("\npattern 1"); delay(); } else if (PORTC & 0x80) { PORTB= 0x0F; printf("\npattern 2"); delay(); PORTB= 0xF0; printf("\npattern 2"); delay(); } else { PORTB= 0x00; printf("\nnothing"); delay(); PORTB= 0x00; printf("\nnothing"); delay(); } } } void delay() {int z; while (z<10000) {asm("NOP"); asm("NOP"); z++;} }