#include "main.h"

int main(void){
	unsigned long Delay=500;
	char flag=0;
	LED_Init();
	Key_Init();
	// Wait until PushButton is pressed PA0=1
	while(!GPIO_ReadInputDataBit(Key_Port,Key_Pin));
	
	while(1){
		Set_Reset_LED1(Delay%1000);
		if(Delay==1000) flag=1;
		if(Delay==0   ) flag=0;
		if(GPIO_ReadInputDataBit(Key_Port,Key_Pin)){
			if(flag==0) Delay++;
			if(flag==1) Delay--;
		}
	}
}