MKR 1010 Wifi Transistor 3V+ 5V

Yes I am very new. The idea is that the pin 13 is providing the 3V energy to manage the logic and the base to the transistor.

  1. connected pin 13 to the supply rail of your breadboard?
  2. are connecting a switch between pin 13 and pin 8?

2.Correct. I am using the 8 to detect when I push the pushbutton. When I detect this then I change a boolean variable that activates the high of pin 12. This pin is the one that provides the voltage to activate the transistor.

If in any time you see that it's better that I try more basics circuit it's ok I dont want to lose your time!

int c_outPuls = 13;
int c_outMotor = 12;
int c_inPuls = 8;
int v_pulsador = 0;
bool v_estadoPuls = false;



void setup() {
  pinMode(c_outPuls,OUTPUT);
  pinMode(c_outMotor,OUTPUT);
  pinMode(c_inPuls,INPUT);

  Serial.begin(9600);
}

void loop() {
  
  // pin 13 always high
  digitalWrite(c_outPuls, HIGH); 
  v_pulsador = digitalRead(c_inPuls);

  
  //Change variable status . If i read that the voltage of pin 8 is low then I change the variable
  if (digitalRead(c_inPuls) == LOW )
  {
     if( v_estadoPuls == true ){
        v_estadoPuls = false;
        Serial.println("TurnOff ");
     }else
     {
      v_estadoPuls = true;
      Serial.println("TurnOn ");
     }
    //Delay reading again 
    delay(1000); 
  }

  if( v_estadoPuls == false ){
    digitalWrite(c_outMotor, LOW); 
  }
  else{
    digitalWrite(c_outMotor, HIGH); 
  }   
}