7-Segment, 3-digit display not displaying correctly
I have three recommendations for you. @Gerben was correct as to your problem, but doing the following three steps will improve the speed of your code:


Change your definition for NumberSegments to be [10][8], and put the number of active segments as the first number of each array:

 ...[10][8] = {{6,a,b,c,d,e,g},     // ...
               {2,b,c},
               {5,a,b,d,e,g}, // etcetera

Change your for loop as follows:

for (int i = 1; i &lt;= NumberSegments[Number][0]; i++) { // ...
   digitalWrite(NumberSegments[Number][i], HIGH); // ...
}


This will only turn on the minimum number of segments required. Note the loop now starts at 1, and uses &lt;= instead of &lt;.
Put the keyword static in front of NumberSegments:

static int NumberSegments[10][8] = {{ // ...



This last one is a language nicety. Every time the function WriteNum is called, the poor thing has to re-create the (large) NumberSegments array - and it’s the same every time! The keyword static means “only create this variable once”. Next time into the function, it’ll already be available: no processing required!

You might also consider moving int position; below NumberSegments, since it’s convention to put static variables first in a function.

You can also use the keyword const on NumberSegments, since its values never change:

static const int NumberSegments[10][8] = {{ // ...