#include #include int main(void) { #if defined(DDRC) && defined(DDRD) #define BITS 8 DDRC = 0x3f; DDRD = DDRB = 0xff; #else #define BITS 6 DDRB = 0x3f; #endif for (;;) { for (uint8_t i = 0; i < BITS; ++i) { #if defined(DDRC) && defined(DDRD) PORTC = (PORTD = PORTB ^= _BV(i))&0x3f; #else PORTB ^= _BV(i); #endif _delay_ms(36); } } return 0; }