//my own tryto find 4 digit function 17-11-2022
void setup() {
// put your setup code here, to run once:
volatile char *dirf,*dirk;
volatile char *outf,*outk;
volatile long i=0,j;
volatile char numcc[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x67};
volatile char numca[]={0xC0,0xF9,0xA4,0xB0,0X99,0X92,0X82,0xF8,0x80,0x98};
dirf = 0x30; dirk = 0x017;
*dirf =0xff; *dirk=0x0f;
outf = 0x31; outk=0x108;
while(1)
{
*outk=0x0f;
if(i<10)
{
*outf=numca[i];
for(j=0;j<500000;j++);
i++;
}
}
}
void loop() {
// put your main code here, to run repeatedly:
}