/* * Use the timers pwm to dim a light on demand. */ #define F_CPU 16000000UL #define __AVR_ATmega328P__ #include #include #include #define PWM_LOW 24 #define PWM_HIGH 192 int state = 0; // code for INT0 ISR(INT0_vect) { OCR0A = PWM_HIGH; // max value for timer PORTB |= (1<