int main(void) { RLY_DDR = _BV(RLY_BIT); PWR_BTN_PORT |= _BV(PWR_BTN_BIT); for (;;) { if (button_is_pressed()) { toggle_relay(); _delay_ms(500); } } }
void button1_toggled() { toggle_relay(); }