typedef unsigned char uint8_t; #define DDRB (*(volatile uint8_t*)0x37) #define PORTB (*(volatile uint8_t*)0x38) void wait(void) { volatile int i; for (i = 0; i < 30000; ++i) /*empty*/; } int main(void) { void wait(void); uint8_t c1, c2, i; DDRB = 0xFF; while (1) { c1 = 0x80; c2 = 0x01; for (i = 0; i < 4; i++) { wait(); PORTB = ~(c1 | c2); c1 >>= 1; c2 <<= 1; } } return 0; }