Oil pressure code help

Hello so I have a oil sensor that I'm using for a pump but I would like for my pump to be stopped when the sensor reaches 3 bars so i will need some help to know what to put inside of this code in order for me to be able to do this.thank you

The code

Void setup(){
Serial begin (9600);
}

Void loop(){
int sensorVal=analogRead(A1);
Serial.print("Sensor Value:");
Serial.print("sensorVal");

float voltage=(sensorVal*5.0)/1024.0;
Serial.print("Volts:");
Serial.print("voltage:");

float pressure_pascal=(3.0*((float)voltage-0.47))*1000000.0);
float pressure_bar=pressure_pascal/10e5;
Serial.print("Pressure=");
Serial.print("pressure_bar=");
Serial.print("bar");
Serial.print("Pressure=")

Delay(100);
}

That code won't compile. Don't forget that you can use the IDE to check it, even if you don't have an Arduino yet.

For your pump, look at if statements and digitalWrite. Try it out with an LED first - don't forget a resistor.

Be careful that your code can't cycle the pump rapidly.

I would be inclined to forget all that math. Just find out what the threshold value is in terms of analogRead and use that.

Looks like your pressure sensor is the 0.5 to 4.5V type, what is the pressure range of the sensor?