// Interrupt that checks whether to buzz the battery void interruptTimer1OverflowBuzzer() { static unsigned char counter = 0; DIGITAL_TOGGLE(PWM1); // Testing // Run this code once every 40 interrupts if (counter > 40) { if (batteryUnsafe()) { TCCR1A = (1 << COM1B1) | (1 << WGM10); // Turn on PWM } else { TCCR1A = (1 << WGM10); // Turn off PWM } counter = 0; } counter++; }
void shiftlight_toggle(void) { DIGITAL_TOGGLE(SHIFT_LIGHT_PORT, SHIFT_LIGHT_R); DIGITAL_TOGGLE(SHIFT_LIGHT_PORT, SHIFT_LIGHT_B); }