7 segment 4 digit display

Hello guys,
I recently bought a 7-segment 4-digit display and i got it to work after a LOT of effort. My display works just fine except the second digit. My code is the following. The problem is that if I change the loop() function writing the 2nd digit[] to HIGH and the segment[] I want to LOW the thing works but if I try calling the writeDigit() function to write a number nothing happens. Even if I call the writeNum() function with a 4-digit number (ex. 1234) every segment turns on correctly except the second one. What am I doing wrong?

int digit[4] = {2,3,4,5};
int segment[7] = {6,7,8,9,10,11,12};
int dot = 13;
int x;
int del = 5;

int num[10][7]= {
  {1,1,1,1,1,1,0},
  {0,0,0,1,1,0,0},
  {1,0,1,1,0,1,1},
  {0,0,1,1,1,1,1},
  {0,1,0,1,1,0,1},
  {0,1,1,0,1,1,1},
  {1,1,1,0,1,1,1},
  {0,0,1,1,1,0,0},
  {1,1,1,1,1,1,1},
  {0,1,1,1,1,1,1}
};

void setup() {
  for (int i = 2; i <= 13; i++){
    pinMode(i, OUTPUT);
  }
  Serial.begin(9600);
  reset();
}

void loop() {
  if (Serial.available() > 0){
    reset();
    x = Serial.parseInt();
  }
  writeNum(x);
}

void writeNum(int x){
  if(x < 10){
    writeDigit(4, x);
    delayMicroseconds(del);
    
  } else if(x < 100){
    writeDigit(3, (x / 10));    
    delayMicroseconds(del);
    
    writeDigit(4, (x % 10));
    delayMicroseconds(del);
    
  } else if(x < 1000){
    writeDigit(2, (x / 100));
    delayMicroseconds(del);
    
    writeDigit(3, ((x%100)/10));
    delayMicroseconds(del);
    
    writeDigit(4, ((x%100)%10));
    delayMicroseconds(del);
  } else {
    int one = x / 1000;
    x = x % 1000;
    int two = x / 100;
    x = x % 100;
    int three = x / 10;
    int four = x % 10;
    
    writeDigit(1, one);
    delayMicroseconds(del);
    
    writeDigit(2, two);
    delayMicroseconds(del);
    
    writeDigit(3, three);
    delayMicroseconds(del);

    writeDigit(4, four);
    delayMicroseconds(del);
  }
}

void writeDigit(int row, int x){
  reset();
  digitalWrite(digit[row-1], HIGH);
  for (int i = 0; i < 7; i++){
    if (num[x][i] == 1){
      digitalWrite(segment[i], LOW);
    }else{
      digitalWrite(segment[i], HIGH);
    }
  }
}

void reset(){
  for (int i = 0; i < 4; i++){
    digitalWrite(digit[i], LOW);
  }
  for (int i = 0; i < 7; i++){
    digitalWrite(segment[i], HIGH);
  }
  digitalWrite(dot, HIGH);
}

hi i tested your code and what i found out is when i remove the Reset(); function from the WriteDigit(); function it seems to work oke for me.

uhmm but now writeNum(); doesnt work anymore.

A 5us delay...

Wouldnt that mean the digits are on for 5us?

5us = 1/5E-6 Hz = 200kHz.

Can your devices actually take a 200KHz refresh rate?

Try upping the del value to say 1E6 for now...

PS> I am a noob and may not be very good at the whole thing, but as far as I can tell (or think) is you are writing a digit for 5 microseconds and then turning it off to write the next digit.

AH maybe not the problem. Sorry.

Why are you writing the number over and over and over? That's a job for a scan routine. I think you're off to a bad start, with no idea how a matrix should be driven.

Is this display being driven directly from an Arduino? Are current limiting resistors used?

Often the digits have a transistor of some sort since an Arduino can't safely drive 7 or 8 LEDs at once (at least not at a reasonable brightness level).