/* # vim: ai ts=4 sts=4 et sw=4 */ #include #include #include #include void delay_ms(unsigned int ms) /* Delay for a min of */ { while (ms) { _delay_ms(0.96); ms--; } } void lightshow_2() { for (int i = 5; i > 1; i--) { // Turn Pin 7, 5, 3 on. PORTB |= (_BV(PB3)); PORTB |= (_BV(PB5)); PORTB |= (_BV(PB7)); // delay_ms(100); // Turn 7,5,3 off. PORTB &= ~(_BV(PB3)); PORTB &= ~(_BV(PB5)); PORTB &= ~(_BV(PB7)); // Turn 4,6 on PORTB |= (_BV(PB4)); PORTB |= (_BV(PB6)); // delay_ms(100); // Pins 4,6 off PORTB &= ~(_BV(PB6)); PORTB &= ~(_BV(PB4)); } // Clear pins PORTB = 0x00; } int main(void) { /* INITIALIZE */ /* Enabled PORTB as output */ DDRB = 1; lightshow_1(); sleep_mode(); return(0); }