#include <htc.h>

#ifndef _XTAL_FREQ
 // Unless already defined assume 4MHz system frequency
 // This definition is required to calibrate __delay_us() and __delay_ms()
 #define _XTAL_FREQ 4000000
#endif

__CONFIG(INTIO & WDTDIS & PWRTEN & MCLRDIS & BORDIS & UNPROTECT & UNPROTECT);

void main()
{
	// Initialize
	CMCON = 0x07;		// Comparator Off
	ADCON0 = 0x00;		// A/D Off
	ANSEL = 0x00;		// Digital I/O
	TRISIO = 0x08;		// GP3: Input, Other All: Output
	GPIO = 0x37;		// Init Value on the I/O Port
			
	// Fõciklus
	while(1)
	{
		GPIO4 = !GPIO4;		// Toggle GP4
		__delay_ms(500);	// Wait ---> f = 1Hz
	}	
}