void setup() {
// put your setup code here, to run once:
volatile char *outF, *inK, *outA,*outC;
volatile char *dirF, *dirK, *dirA, *dirC;
outF=0x31;inK=0x106;outA=0x22;outC=0x28; // Address initialization
dirF=0x30;dirK=0x107;dirA=0x21;dirC=0x27; // Direction Initialization
*dirF=0x0F;*dirK=0x00;*dirA=0x0F;*dirC=0x0F;
while(1){
for(int i=0;i<4;i++){
*outF=1<<i; // output column connection
*outA=*inK; // read the input value, ROW identification
if(*inK !=0){
*outC=1<<i; // Column Identification
for(volatile long j=0;j<200000;j++); //Delay
*outC=0x00;
}
}
}
//Blue LED - coloumn and Yellow LED - Row
}
void loop() {
// put your main code here, to run repeatedly:
}