Display 7 segment with ESP-WROOM-32

The final project has been with Xavier Garrido. Having an ESP-WROOM-32 board we decided to make a counter from a push button and as the title of the project says, with a display as well.
The initial bill of materials was as follows:
The operation of the displays depends on the model (whether it is anode or cathode) and on its segments [a,b,c,d,e,f,g]. They are connected as follows:
We decided to make at first a code created by us (which had many errors and is not finished), with a circuit extracted from the internet. The problem is that many of the circuits we found were with Arduino UNO and not with a board of our type. So from that with the first code, we counted the circuit.
The first code would look like this:

const int a = 22;
const int b = 23;
const int c = 5;
const int d = 4;
const int e = 15;
const int f = 21;
const int g = 19;
const int dot = 18;
const int forward = 34;
const int backward = 35;
const int red = 32;
const int yallow = 33;
int counter;
void setup() {
  // put your setup code here, to run once:
pinMode (a, OUTPUT);
pinMode (b, OUTPUT);
pinMode (c, OUTPUT);
pinMode (d, OUTPUT);
pinMode (e, OUTPUT);
pinMode (f,OUTPUT);
pinMode (g, OUTPUT);
pinMode (dot, OUTPUT);
pinMode(forward,INPUT);
pinMode(backward,INPUT);
pinMode(red, OUTPUT);
pinMode(yallow,OUTPUT);
}
void zero()
{
  digitalWrite(a,1);
  digitalWrite(b,1);
  digitalWrite(c,1);
  digitalWrite(d,1);
  digitalWrite(e,1);
  digitalWrite(f,1);
  digitalWrite(g,0);
  digitalWrite(dot,1);
 
}
void one()
{
  digitalWrite(a,0);
  digitalWrite(b,1);
  digitalWrite(c,1);
  digitalWrite(d,0);
  digitalWrite(e,0);
  digitalWrite(f,0);
  digitalWrite(g,0);
  digitalWrite(dot,1);
 
}
void two()
{
  digitalWrite(a,1);
  digitalWrite(b,1);
  digitalWrite(c,0);
  digitalWrite(d,1);
  digitalWrite(e,1);
  digitalWrite(f,0);
  digitalWrite(g,1);
  digitalWrite(dot,1);
 
}
void three()
{
  digitalWrite(a,1);
  digitalWrite(b,1);
  digitalWrite(c,1);
  digitalWrite(d,1);
  digitalWrite(e,0);
  digitalWrite(f,0);
  digitalWrite(g,1);
  digitalWrite(dot,1);
 
}
void four()
{
  digitalWrite(a,0);
  digitalWrite(b,1);
  digitalWrite(c,1);
  digitalWrite(d,0);
  digitalWrite(e,0);
  digitalWrite(f,1);
  digitalWrite(g,1);
  digitalWrite(dot,1);
 
}
void five()
{
  digitalWrite(a,1);
  digitalWrite(b,0);
  digitalWrite(c,1);
  digitalWrite(d,1);
  digitalWrite(e,0);
  digitalWrite(f,1);
  digitalWrite(g,1);
  digitalWrite(dot,1);
 
}
void six()
{
  digitalWrite(a,1);
  digitalWrite(b,0);
  digitalWrite(c,1);
  digitalWrite(d,1);
  digitalWrite(e,1);
  digitalWrite(f,1);
  digitalWrite(g,1);
  digitalWrite(dot,1);
 
}
void seven()
{
  digitalWrite(a,1);
  digitalWrite(b,1);
  digitalWrite(c,1);
  digitalWrite(d,0);
  digitalWrite(e,0);
  digitalWrite(f,0);
  digitalWrite(g,0);
  digitalWrite(dot,1);
 
}
void eight()
{
  digitalWrite(a,1);
  digitalWrite(b,1);
  digitalWrite(c,1);
  digitalWrite(d,1);
  digitalWrite(e,1);
  digitalWrite(f,1);
  digitalWrite(g,1);
  digitalWrite(dot,1);
 
}
void nine()
{
  digitalWrite(a,1);
  digitalWrite(b,1);
  digitalWrite(c,1);
  digitalWrite(d,1);
  digitalWrite(e,0);
  digitalWrite(f,1);
  digitalWrite(g,1);
  digitalWrite(dot,1);
 
}
void swich(int a)
{
  switch(a)
  {
    case 0:
    zero ();
    break;
case 1:
    one ();
    break;
    case 2:
    two();
    break;
    case 3:
    three();
    break;
    case 4:
    four();
    break;
    case 5:
    five();
    break;
    case 6:
    six();
    break;
   case 7:
    seven ();
    break;
    case 8:
    eight();
    break;
    case 9:
    nine();
    break;
    }
  }
void loop() {
 if(counter >9){counter =0;}
 if(digitalRead(forward)==1){counter ++;
 digitalWrite(red,1);
 delay(300);
 digitalWrite(red,0);}

if (digitalRead(backward)== 1){counter --;
digitalWrite(yallow,1);
delay(300);
digitalWrite(yallow,0);}
switch(counter);
}

With this code we spent a week looking at how it could work, but there was no response. In this way we understood that big problems are divided into small steps. With this idea, we started to make codes to see that each segment worked. Knowing more about the display we decided to copy a code and a circuit that was for our type of board.
The code was as follows

byte pin[] = {15,2,4,5,18,19,21};   //   Seven segment pin is connected to Digital pin 15,2,4,5,18,19,21 to a,b,c,d,e,f,g

const byte count[10] = {  // this is data code for Seven segment
  //GFEDCBA
  B00111111,  //0
  B00000110, // 1
  B01011011, // 2
  B01001111, //3
  B01100110, //4
  B01101101, //5
  B01111101, //6
  B00000111, //7
  B01111111, //8
  B01101111, //9
};
void setup() {
  pinMode(pin[0], OUTPUT);  // every pin is output
  pinMode(pin[1], OUTPUT);
  pinMode(pin[2], OUTPUT);
  pinMode(pin[3], OUTPUT);
  pinMode(pin[4], OUTPUT);
  pinMode(pin[5], OUTPUT);
  pinMode(pin[6], OUTPUT);
}
void loop() {
  for(int i = 0; i < 10; i++){ // printing the number on seven segment
    SevenSeg(count[i]);
    delay(1000);
  }
}
void SevenSeg(byte Bit) { //  sending data on each pin
  for(int i=0; i < 8; i++)
  digitalWrite(pin[i],bitRead(Bit,i));
}

Once we knew that the code was more likely to work and that it was our board, we saw that it also had a video showing that it worked, so we confidently decided to apply it.
To our bad luck, two errors appeared all the time, which we had no idea what they were. The first one was an error that said the following: "error in: packet header". So we decided to send the code to the board again and another one came out saying: "error in: packet content", this repeatedly, we decided to look for information, but apparently nobody knew how to solve it.
It was on a web page where it said that it was possible due to the lack of libraries, so we decided to install some that could be useful. In turn, some of the ".ZIP" type, but to our bad luck there was no way to work.
Although we have not yet finished the work, I have managed to draw a first conclusion: The ESP-WROOM-32 board is a board which is relatively new, which means that many of the programs we use do not recognize it at all and, at the same time, people have not developed code models. That is why Arduino UNO has a higher computational development and in the field of utilities is better.
Finally, I want to let you know that Xavier have worked more than me here in the web and he deserves that it be known because he worked so hard in this project.