Help setting a push button to turn off a process

Hi. I wonder if someone could help me. My project is very simple. I connected my arduino to a voltage source and it turns off a vibration motor whenever it detects an external voltage and turns it on whenever it doesn't. I use this to remove bubbles from an electrolytic cell. Everything works fine except at the end of the process when I need to safely dismantle the cell (I use hydrofluoric acid as electrolyte) and I need the motor to stop vibrating. The easiest thing to do was just to unplug a jumper from the board but I thought I could do something better and I thought I could add a push button to abort the process whenever I need. I've been searching the internet for solutions and I've seen plenty but none is working for me. The only thing I could get was to send the digitalWrite to a low when I press the button but as soon as I remove my finger it goes back to HIGH. So in short, I just want my current program to send my digitalWrite from HIGH to LOW whenever I press a button but I want it to stay LOW after removing my finger. I hope you can help me. Thank you so much. I'm also attaching a diagram of my set up (not totally accurate) but it might be that I'm not even plugin the button in a proper way?.

const int boton = 2;
float entrada;
const int motor = 9; 
int estado_boton = 0;

void setup() {
 pinMode(motor, OUTPUT);
pinMode(boton, INPUT_PULLUP);
Serial.begin(9600);
}

void loop() {
entrada = analogRead(A0);
estado_boton = digitalRead(boton); 
 
if(entrada > 100 || estado_boton == HIGH) {
Serial.println(entrada);
digitalWrite(motor, LOW); 
}

else if (entrada < 200) {

Serial.println(entrada);
digitalWrite(motor, HIGH);
  
}
}

You need to track button state CHANGES not where it is (ie LOW To HIGH transition - mind the bounce) to alternate a state variable between IDLE or RUNNING

I figured I had to keep track of the buttons state but I honestly have no idea how to program it. I tried some codes from the web but they all mess with my original code :confused:

opus9:
I figured I had to keep track of the buttons state but I honestly have no idea how to program it. I tried some codes from the web but they all mess with my original code :confused:

Take a look at the StateChangeDetection example in the IDE