// Global Variables // Subroutine Declarations #include // Subroutines void Display(unsigned char X) { if (X == 0) PORTD = 1; if (X == 1) PORTD = 2; if (X == 2) PORTD = 4; if (X == 3) PORTD = 8; if (X == 4) PORTD = 0x10; if (X == 5) PORTD = 0x20; if (X == 6) PORTD = 0x40; if (X == 7) PORTD = 0x80; } void Wait(unsigned int X) { unsigned int i, j; for(i=0; i0; i--) { Y = (Y + 1) % 8; Display(Y); Beep(); Wait(100 + 1000/(i+1)); } } }