#define F_CPU 1000000UL #include #include #define TRUE 1 #define FALSE 0 // Globals volatile uint8_t light; volatile uint8_t down; //************************************** // Interrupts here //************************************** ISR(TIMER1_COMPA_vect){ // At eight or above, count down if(light >= 7) down = TRUE; // At zero, count up if(light == 0) down = FALSE; if(down) light--; else light++; } //************************************** // Main starts here //************************************** int main(void) { // set PA to output DDRA = 0xff; // Set up timer TCCR1B |= (1<