#include "pic/pic16f684.h"

typedef unsigned int config;
config at 0x2007 __CONFIG =
    _FCMEN_OFF &
    _IESO_OFF &
    _BOD_OFF &
    _CPD_OFF &
    _CP_OFF &
    _MCLRE_OFF &
    _PWRTE_ON &
    _WDT_OFF &
    _INTRC_OSC_NOCLKOUT;

#define RED (1<<2)
#define GREEN (1<<0)
#define BLUE (1<<1)

void main(void)
{
	TRISA &=~ (RED | GREEN | BLUE);

	while (1) {
		if (PORTA & (1<<3))
			PORTA = RED | GREEN;
		else
			PORTA = BLUE;
	}
}

