#include "port_setup.h"
//#include "arraytobin.h"
void setup()
{
portf_dir(0x0f);//output row
portk_dir(0xf0);//input coloumn
porta_dir(0x0f);//output Coloumn RED LEDs
portc_dir(0x0f);//output Row GREEN LEDs
//porta_data(0x05); //check
volatile long i,j,x,out,ink,ina;
while(1){
for (i = 0; i<4; i++)
{
x = (0x01<<i);
portf_data(x);
ink = read_portk();
if(ink!=0x00)
{
porta_data(ink);
portc_data(x);
for(j=0; j<100000; j++);
}
porta_data(0x00);
portc_data(0x00);
}
}
}
void loop()
{
}