#include <avr/io.h>
#include <util/delay.h>

#include "macros.h"

// toggle LED1 when BUTTON1 is pressed
int main() {
	MODE_OUTPUT(LED1);
	MODE_INPUT(BUTTON1);
	while(1) {
		if (IS_PIN_SET(BUTTON1)) {
			TOGGLE_PIN(LED1);
			_delay_ms(20);
			while(IS_PIN_SET(BUTTON1)) {
				continue;
			}
			_delay_ms(20);
 		}
	}
}