Why this code is not running??

Hi everyone... I must be missing something with this code cause I can´t make it work. The first thing I suposed to see in the monitor serial is "Pines digitales" but i don't see nohing... If anyone see any mistkae in the code please let me know.

Thanks so much.

int input;
  
void setup(){
  Serial.begin(115200);

}

void digitales1(){
 Serial.println("Pines digitales");
 delay(100);
 digitalWrite(0, HIGH); 
 digitalWrite(1, HIGH); 
 digitalWrite(2, HIGH); 
 digitalWrite(3, HIGH); 
 digitalWrite(4, HIGH); 
 digitalWrite(5, HIGH); 
 digitalWrite(6, HIGH); 
 digitalWrite(7, HIGH); 
 digitalWrite(8, HIGH); 
 digitalWrite(9, HIGH); 
 digitalWrite(10, HIGH); 
 digitalWrite(11, HIGH); 
 digitalWrite(12, HIGH); 
 digitalWrite(13, HIGH); 
 digitalWrite(14, HIGH); 
 digitalWrite(15, HIGH); 
 digitalWrite(16, HIGH); 
 digitalWrite(17, HIGH); 
 digitalWrite(18, HIGH); 
 digitalWrite(19, HIGH); 
 digitalWrite(20, HIGH); 
 digitalWrite(21, HIGH); 
 digitalWrite(22, HIGH); 
 digitalWrite(23, HIGH); 
 digitalWrite(24, HIGH); 
 digitalWrite(25, HIGH); 
 digitalWrite(27, HIGH);
 digitalWrite(28, HIGH); 
 digitalWrite(29, HIGH); 
 digitalWrite(30, HIGH); 
 digitalWrite(31, HIGH); 
 digitalWrite(32, HIGH); 
 digitalWrite(33, HIGH); 
 digitalWrite(34, HIGH); 
 digitalWrite(35, HIGH); 
 digitalWrite(37, HIGH); 
 digitalWrite(39, HIGH); 
 digitalWrite(41, HIGH); 
 digitalWrite(43, HIGH); 
 digitalWrite(45, HIGH); 
 digitalWrite(47, HIGH); 
 digitalWrite(49, HIGH); 
 digitalWrite(51, HIGH); 
 digitalWrite(53, HIGH); 
 digitales2();
 }

void digitales2(){
 input=Serial.read(); 
 if (input=='1'){
 sensor1(); }
 digitales2();
 }

void sensor1(){
  Serial.print("Valores Sensor (A10, A11, A12): ");
  Serial.print(analogRead(A10));
  Serial.print(",");
  Serial.print(analogRead(A11));
  Serial.print(",");
  Serial.println(analogRead(A12));
  sensor2();
}

void sensor2(){
  input=Serial.read(); 
  if (input=='1'){
  descbat1(); }
  sensor2();
}

void descbat1(){
  Serial.print("Valores Descbat (A0): ");
  Serial.println(analogRead(A0));    
  descbat2();
}

void descbat2(){
  input=Serial.read(); 
  if (input=='1'){
  divisor12V1(); }
  descbat2();
}

void divisor12V1(){
  Serial.print("Valores divisor 12V (A1, A2, A3, A4): ");
  Serial.print(analogRead(A1));
  Serial.print(",");
  Serial.print(analogRead(A2));
  Serial.print(",");
  Serial.print(analogRead(A3));  
  Serial.print(",");
  Serial.println(analogRead(A4));
  divisor12V2();
}

void divisor12V2(){
  input=Serial.read(); 
  if (input=='1'){
  divisor48V1(); }
  divisor12V2();
}

void divisor48V1(){
  Serial.print("Valores divisor 48V (A5, A6, A7, A8): ");
  Serial.print(analogRead(A5));
  Serial.print(",");
  Serial.print(analogRead(A6));
  Serial.print(",");
  Serial.print(analogRead(A7));  
  Serial.print(",");
  Serial.println(analogRead(A8));
  divisor48V2();
}

void divisor48V2(){
  input=Serial.read(); 
  if (input=='1'){
  divisor80V1(); }
  divisor48V2();
}

void divisor80V1(){
  Serial.print("Valores divisor 80V (A9, A13, A14, A15): ");
  Serial.print(analogRead(A9));
  Serial.print(",");
  Serial.print(analogRead(A13));
  Serial.print(",");
  Serial.print(analogRead(A14));  
  Serial.print(",");
  Serial.println(analogRead(A15));
  divisor80V2();
}
  
void divisor80V2(){
  input=Serial.read(); 
  if (input=='1'){
  final1(); }
  divisor80V2();
}

void final1(){
  Serial.println("Comprobación finalizada");
  Serial.println("¿Repetir el proceso? 1=NO 2=SI");
  final2();
}

void final2(){
  input=Serial.read(); 
  if (input=='1'){
  final3(); }
  else if(input=='2'){
  digitales1();}
  final2();
}
  
void final3(){
  Serial.println("                                FIN!!!!!!!!!!!!!!!");
  loop();
}

void loop(){
 input=Serial.read(); 
}

If anyone see any mistkae in the code please let me know.

Which pins are used for the hardware serial instance you are using to talk to the PC? Pins 0 and 1. You are diddling with them in digitales1().

In your code, setup() will be called, which connects to the serial port. Then, loop() will be called over and over. It doesn't actually do anything useful, so I'm not sure why you expect to see any serial output.

In the future, put setup() and loop() at the top of your code. There is no reason for use to have to scroll all over the place to find the two most important functions.

To see that message you're going to have to call digitales1 from either setup or loop.

When you do though, your sketch will crash because of all the recursive calls you have - e.g. digitales2 calls itself.

You never call "digitales1", so it isn't surprising you see nothing.

Your sketch is this:

int input;
  
void setup(){
  Serial.begin(115200);

}

void loop(){
 input=Serial.read(); 
}

Why this code is not running

So now you see the code is running and doing exactly what you told it to do.

Thank you guys,

The code I post was wrong, the loop should be like this:

void loop() { digitales1(); }

But with this it doesn't work either. I tried to rebuild the code and find out that if I delete the function "final3()" it works fine! Don't now why....but it works. I tried to delete the loop() call in function final3() to see if that was the problem but no...I have to remove the entire function final3() and now it works perfect... Any idea why?

Thanks again for you answers.

Because final3 calls loop, which is recursion.

You are still using pins 0 and 1 and the serial port, you can not do that. You are writing HIGH to a lot of pins but never setting the pinMode of these pins.

As well as the recursion.

Definition:- Recursion - See Recursion