const int Rowpin[] = {4,5,7,8}; const int Colpin[] = {10,15,14,16}; const int Cols = (sizeof(Rowpin)/sizeof(Rowpin[0])); const int Rows = (sizeof(Colpin)/sizeof(Colpin[0])); bool beforeState[Rows][Cols]; bool currentState[Rows][Cols]; void setup(){ Serial.begin(9600); while(!Serial); Serial.println("Started."); for(int i=0;i