Trouble with 7-segment led's

Hello,

I'm trying to make a score board from three 7-segmend LED's that gets incremented from switches. I'm using a schematic that someone posted on here previously for it (attached). My problem is that all the segments stay lit, no matter what I change to the code. It was previously changing like it was supposed to before but now they all just display 8 (all segments on). I was wondering what could be wrong? or maybe some suggestions to trouble shoot.

Thanks

#include "LedControl.h"
#include <Servo.h> 

Servo myservo;
LedControl lc=LedControl(12,11,10,1); 

int n = 0 ;
int numberArray[2];


int buttonPin1 = 2;
int buttonPin2 = 3;
int buttonPin3 = 4;
int buttonPin4 = 5;
int buttonPin5 = 6;
int buttonState1 = 0;
int buttonState2 = 0;
int buttonState3 = 0;
int buttonState4 = 0;
int buttonState5 = 0;
int resetbutton = 8;
int resetstate = 0;
int count = 0;
//int a = 5;
void setup() {
 

Serial.begin(9600);
myservo.attach(9);
  lc.shutdown(0,false);
  /* Set the brightness to a medium values */
  lc.setIntensity(0,8);
  /* and clear the display */
  lc.clearDisplay(0);
  
  delay(1000);

/*lc.setDigit(0,1,(byte)0,false);
 lc.setDigit(0,0,(byte)0,false);
 lc.setDigit(0,2,(byte)0,false);
 */
numberArray[0] = 0;
numberArray[1] = 0;
     
}
 
void loop() { while(1){

buttonState1 = digitalRead(buttonPin1);
buttonState2 = digitalRead(buttonPin2);
buttonState3 = digitalRead(buttonPin3);
buttonState4 = digitalRead(buttonPin4);
buttonState5 = digitalRead(buttonPin5);
resetstate= digitalRead(resetbutton);


if (count == 0) {
 
 lc.setDigit(0,3,(byte)1,false);
 lc.setDigit(0,4,(byte)0,false);
 }
  
if (buttonState1 == HIGH) {
  if (n == 9) {
  numberArray[1]++;  
  n = 0;}
    else { 
      n++;}
     numberArray[0] = n;
     count++;
      
      delay(300);
}
  
if (buttonState2 == HIGH) {
  if (n == 8) {
   numberArray[1]++;  
  n = 0;}
  else if (n == 9) {
    numberArray[1]++;
    n = 1; }
    else { 
      n = n + 2;}
      numberArray[0] = n;
       count++;
      
      delay(300);
}

 if (buttonState3 == HIGH) {
  if (n == 7) {
   numberArray[1]++;  
  n = 0;}
  else if (n == 8) {
    numberArray[1]++;
    n = 1; }
   else if (n == 9) {
    numberArray[1]++;
    n = 2; } 
    else { 
      n = n + 3;}
      numberArray[0] = n;
       count++;
      
      delay(300);
}

if (buttonState4 == HIGH) {
  if (n == 6) {
   numberArray[1]++;  
  n = 0;}
  else if (n == 7) {
    numberArray[1]++;
    n = 1; }
   else if (n == 8) {
    numberArray[1]++;
    n = 2; } 
    else if (n == 9) {
      numberArray[1]++;
      n = 3; }
    else { 
      n = n + 4;}
      numberArray[0] = n;
       count++;
      
      delay(300);
}

if (buttonState5 == HIGH) {
  if (n == 5) {
   numberArray[1]++;  
  n = 0;}
  else if (n == 6) {
    numberArray[1]++;
    n = 1; }
   else if (n == 7) {
    numberArray[1]++;
    n = 2; } 
    else if (n == 8) {
      numberArray[1]++;
      n = 3; }
    else if (n == 9) {
      numberArray[1]++;
      n = 4; }
    else { 
      n = n + 5;}
      numberArray[0] = n;
       count++;
      
      delay(300);
}


if (count == 1){
  lc.setDigit(0,3,(byte)0,false);
  lc.setDigit(0,4,(byte)9,false);
}
else if (count == 2) {
  lc.setDigit(0,4,(byte)8,false);
}
else if (count == 3) {
  lc.setDigit(0,4,(byte)7,false);
}
else if (count == 4) {
  lc.setDigit(0,4,(byte)6,false);
}
else if (count == 5) {
  lc.setDigit(0,4,(byte)5,false);
}
else if (count == 6) {
  lc.setDigit(0,4,(byte)4,false);
}
else if (count == 7) {
  lc.setDigit(0,4,(byte)3,false);
}
else if (count == 8) {
  lc.setDigit(0,4,(byte)2,false);
}
else if (count == 9) {
  lc.setDigit(0,4,(byte)1,false);
}
else if(count == 10) {
  lc.setDigit(0,4,(byte)0,false);
}
  
  

if(count == 10) {

    myservo.write(180);}
    else{
    myservo.write(0);
    
    }
 
if (resetstate == LOW) {
 count = 0;
 numberArray[0] = 0;
 numberArray[1] = 0;
 numberArray[2] = 0;
n = 0;

 
}

    

    
lc.setDigit(0,1,(byte)numberArray[0],false);
lc.setDigit(0,0,(byte)numberArray[1],false);
lc.setDigit(0,2,(byte)0,false);
} 

}

Sorry for the lack of commenting, its based off a maxim7219 library example.

circuit.pdf (46.2 KB)

seven segment led.pdf (154 KB)

I am sorry if my reply is limited - but I just stopped reading when I got to :

It was previously changing like it was supposed to before but now they all just display 8

There are two scenarios in my mind:

  1. What did you change between "working" and "all lit"? Just undo that!

  2. Puff of smoke or suchlike. Try another segment/board/Arduino.

If you are lost, in so far as you have changed lots of things do not know what works or such like, then start with a simple Blink sketch in the arduino (to ensure it works) and then connect the 13 to one LED segment (through the appropiate IC driver chips) to verify the LED and circuits.

Msquare:
I am sorry if my reply is limited - but I just stopped reading when I got to :

It was previously changing like it was supposed to before but now they all just display 8

There are two scenarios in my mind:

  1. What did you change between "working" and "all lit"? Just undo that!

  2. Puff of smoke or suchlike. Try another segment/board/Arduino.

If you are lost, in so far as you have changed lots of things do not know what works or such like, then start with a simple Blink sketch in the arduino (to ensure it works) and then connect the 13 to one LED segment (through the appropiate IC driver chips) to verify the LED and circuits.

Same here, and I'm going to guess that you drew too much current from the IC's and beckoned the magic smoke.