7 segment

Hello, i'm verry new to arduino and programming it.
I wanted to make a 3 digit display that counts up 1 when i press on a button and subtracts 1 when i press on another button.
I made the circuit hooked up the 3 digit 7 segment display and made the outputs of each digit go into the collector of a npn transistor, i connected the base to the arduino and the emitor to ground. whenever i want to display something on the 7 segment display it does not display anything this is my code:

int LedB = 2;
int LedLB = 3;
int LedRB = 4;
int LedM = 5;
int LedLO = 6;
int LedRO = 7;
int LedO = 8;
int button = 9;
int counter = 0;
int button2 = 10;
int DigitL = 11;
int DigitM = 12;
int DigitR = 13;

void setup() {
// put your setup code here, to run once:
pinMode(LedB, OUTPUT);
pinMode(LedLB, OUTPUT);
pinMode(LedRB, OUTPUT);
pinMode(LedM, OUTPUT);
pinMode(LedLO, OUTPUT);
pinMode(LedRO, OUTPUT);
pinMode(LedO, OUTPUT);
pinMode(button, INPUT);
pinMode(button2, INPUT);
pinMode(DigitL, OUTPUT);
pinMode(DigitM, OUTPUT);
pinMode(DigitR, OUTPUT);
}

void loop() {
// put your main code here, to run repeatedly:
if(digitalRead(button) == HIGH)
{
counter = counter + 1;
delay(200);
}
if(digitalRead(button2) == HIGH)
{
counter = counter - 1;
delay(200);
}
if(counter == 1)
{
digitalWrite(LedB, LOW); //Write all other outputs LOW
digitalWrite(LedLB, LOW);
digitalWrite(LedM, LOW);
digitalWrite(LedLO, LOW);
digitalWrite(LedO, LOW);

digitalWrite(LedRB, HIGH); //Write outputs HIGH for 7 segment
digitalWrite(LedRO, HIGH);

digitalWrite(DigitR, HIGH); //Digit selection
digitalWrite(DigitM, LOW);
digitalWrite(DigitL, LOW);
}
if(counter == 2)
{
digitalWrite(LedB, HIGH);
digitalWrite(LedRB, HIGH);
digitalWrite(LedM, HIGH);
digitalWrite(LedLO, HIGH);
digitalWrite(LedO, HIGH);

digitalWrite(LedLB, LOW);
digitalWrite(LedRO, LOW);

digitalWrite(DigitR, HIGH); //Digit selection
digitalWrite(DigitM, LOW);
digitalWrite(DigitL, LOW);
}
if(counter == 3)
{
digitalWrite(LedRB, HIGH);
digitalWrite(LedRO, HIGH);
digitalWrite(LedB, HIGH);
digitalWrite(LedM, HIGH);
digitalWrite(LedO, HIGH);

digitalWrite(LedLB, LOW);
digitalWrite(LedLO, LOW);

digitalWrite(DigitR, HIGH); //Digit selection
digitalWrite(DigitM, LOW);
digitalWrite(DigitL, LOW);
}
if(counter == 4)
{
digitalWrite(LedRB, HIGH);
digitalWrite(LedRO, HIGH);
digitalWrite(LedM, HIGH);
digitalWrite(LedLB, HIGH);

digitalWrite(LedB, LOW);
digitalWrite(LedO, LOW);
digitalWrite(LedLO, LOW);

digitalWrite(DigitR, HIGH); //Digit selection
digitalWrite(DigitM, LOW);
digitalWrite(DigitL, LOW);
}
if(counter == 5)
{
digitalWrite(LedB, HIGH);
digitalWrite(LedLB, HIGH);
digitalWrite(LedM, HIGH);
digitalWrite(LedRO, HIGH);
digitalWrite(LedO, HIGH);

digitalWrite(LedRB, LOW);
digitalWrite(LedLO, LOW);

digitalWrite(DigitR, HIGH); //Digit selection
digitalWrite(DigitM, LOW);
digitalWrite(DigitL, LOW);
}
if(counter == 6)
{
digitalWrite(LedB, HIGH);
digitalWrite(LedLB, HIGH);
digitalWrite(LedLO, HIGH);
digitalWrite(LedM, HIGH);
digitalWrite(LedRO, HIGH);
digitalWrite(LedO, HIGH);
digitalWrite(LedRB, LOW);

digitalWrite(DigitR, HIGH); //Digit selection
digitalWrite(DigitM, LOW);
digitalWrite(DigitL, LOW);
}
if(counter == 7)
{
digitalWrite(LedB, HIGH);
digitalWrite(LedRB, HIGH);
digitalWrite(LedRO, HIGH);
digitalWrite(LedM, LOW);
digitalWrite(LedO, LOW);
digitalWrite(LedLB, LOW);
digitalWrite(LedLO, LOW);

digitalWrite(DigitR, HIGH); //Digit selection
digitalWrite(DigitM, LOW);
digitalWrite(DigitL, LOW);
}
if(counter == 8)
{
digitalWrite(LedB, HIGH);
digitalWrite(LedRB, HIGH);
digitalWrite(LedRO, HIGH);
digitalWrite(LedM, HIGH);
digitalWrite(LedO, HIGH);
digitalWrite(LedLB, HIGH);
digitalWrite(LedLO, HIGH);

digitalWrite(DigitR, HIGH); //Digit selection
digitalWrite(DigitM, LOW);
digitalWrite(DigitL, LOW);
}
if(counter == 9)
{
digitalWrite(LedB, HIGH);
digitalWrite(LedRB, HIGH);
digitalWrite(LedRO, HIGH);
digitalWrite(LedM, HIGH);
digitalWrite(LedO, HIGH);
digitalWrite(LedLB, HIGH);
digitalWrite(LedLO, LOW);

digitalWrite(DigitR, HIGH); //Digit selection
digitalWrite(DigitM, LOW);
digitalWrite(DigitL, LOW);
}
if(counter == 0)
{
digitalWrite(LedB, HIGH);
digitalWrite(LedRB, HIGH);
digitalWrite(LedRO, HIGH);
digitalWrite(LedM, LOW);
digitalWrite(LedO, HIGH);
digitalWrite(LedLB, HIGH);
digitalWrite(LedLO, HIGH);

digitalWrite(DigitR, HIGH); //Digit selection
digitalWrite(DigitM, LOW);
digitalWrite(DigitL, LOW);
}
if(counter == -1)
{
counter = 9;
}
if(counter >= 10)
{
counter = 0;
}
}

the led outputs go to the 7 segment display and the digit outputs go to the base of each transistor to control what digit is on and wich one isn't.
what am i doing wrong ?

thank you

Did you write a simple test program to light each segment in order, without bothering to read inputs?
How did it perform?

Is this post in any way related to this?

You don’t say what result you’re getting that you don’t want.

For starters, resistors between the arduino pins and the transistor bases? Resistors between the arduino pins and the leds?

Is the display common anode or common cathode? You understand the way you described connecting the digit pins effectively inverts the output, right?

And put your code in code tags.

In other words, like this:
Multiplexing digits.jpg

That is quite a complicated way to form the digits, as well as actually potentially having to light up 21 LEDs at the same time. That's a 420ma draw since you're not multiplexing.

Learning how to use arrays would be vastly beneficial here.
One array for the digit slot, one array for the 10 numbers.
Each segment (labelled by you as B/R/M/RB/etc assuming to mean bottom, right, middle, right bottom, etc) gets its own pin, the pins are numbered sequentially, your ordering is arbitrary and reinventing the wheel less usefully.
Try using a guide like this, which later on you will find most code and libraries use as convention.

Then for each number you want to display, you have the right idea about going segment to segment with HIGH/LOW, but it'd be simpler to turn that into a 1101101 for segment A-G.

The way you have it set up, you literally will need instructions for every single number up to 999.
The transistor is not necessary, digit selection can be software controlled, and that's kind of the point of using a microcontroller at all, I think.