Code: Select all
' Case >= 1000000 '7 digits
Case > 999999 '7 digits
LED_Data = num/1000000
LED_Reg = 2
WriteLED
When the line was modified as shown by the second line to just test the "greater than" case, 1000000 does satisfy the test.
The values are all integers ( not floats) so it's not a case of rounding error or "close enough".
This causes a very strange error in parsing the data. Instead of being a 1 for the current digit, a number like 1000000 becomes a 10 for the next digit, and a 10 is the value for a negative sign in the decode mode on the As1106 / MAX7219. This error took a while to track down!