i try this but it break code.
#include "LedControl.h"
LedControl lc=LedControl(10,9,8,1);
int keypress ;
const int buttonPin = 3;
void setup()
{
pinMode (buttonPin, INPUT);
pinMode(2, INPUT);
attachInterrupt(0, pause,CHANGE);
lc.setIntensity(0,8);
lc.shutdown(0,false); // need to take MAX out of shutdown
lc.clearDisplay(0);
delay(10);
}
void loop()
{
for(int row=0;row<4;row++) {
for(int col=0;col<8;col++) {
delay(100);
lc.setLed(0,col,row,true);
if(keypress==1){
break;
}
}
}
keypress = 0;
lc.clearDisplay(0);
}
void pause()
{
keypress = 1;
}