//volatile char *dirf,*dirk,*outf,*outk;
#define DELAY 10000
void setup() {
volatile char *dirf=0x30,*dirk=0x107,*outf=0x31,*outk=0x108;
*dirf=0xFF,*dirk=0xFF;
char digit[] = {0b00000001, 0b00000010, 0b00000100,
0b00001000, 0b00010000, 0b00100000,
0b01000000, 0b10000000};
char cntl[] = {0b11111110, 0b11111101, 0b11111011,
0b11110111, 0b11101111, 0b11011111,
0b10111111, 0b01111111};
// *outf = digit[0]; // Assuming the top-left LED is connected to the first pin in the row
// *outk = cntl[0];
int i=0;
while(i<50){
for(volatile int k=0;k<8;k++){
*outf=digit[k];
*outk=cntl[k];
delay(5);
*outk=0xFF;
}
}
}
void loop() {
// put your main code here, to run repeatedly:
}