- Not a good idea to use pins 0 and 1 as they are the serial comms pins. Start at 2.
- The case statement can take any values, including 0 and negative.
void Dis(int b,int a=7) // function to define the ports i need to be turned on to display various digits [0 to 9]
{
off(a);
b+=1; // didnt know if 'case' could take values of 0 so i just incremented the digit to be displayed by 1.
switch(b)
{
The only difference between an 8 and a 9 is one LED segment - could this be connected to output 7 which you are ALWAYS turning OFF in the code above (for no real reason that I can see)?
Also, post your code using the # not the quotation. It makes it easier to read.