SparkFun Forums 

Where electronics enthusiasts find answers.

General project discussion / help
Did you make a robotic coffee pot which implements HTCPCP and decafs unauthorized users? Show it off here!
By madbodger
#199509
That's known as "leading zero blanking". Normally when I do this, I go the other way (high digits to low digits), and have a blanking flag that starts as "true" and is set to "false" when I encounter the first non-zero digit or get to the last digit (so as not to blank the entire display). When displaying a digit, I check the flag and only disply the digit if the flag is false. However, this would be a large rewrite to your code (expecially as it looks like the large digit driver goes the other way).

Therefore, I'd just do it the quick and dirty way, and take advantage of the fact that there are only two digits and you only need to blank one of them if it's a zero. In the for() loop in showNumber(), before the call to postNumber(), I'd add something like:

if ((byte == 1) && (remainder == 0)) {
// leading digit is zero, blank it
remainder = ' ';
}

This checks to see if it's the first digit and it's a zero, and if so, it replaces the number with a space. Fortunately, the postNumber() routine has code to display nothing when given a space instead of a number.