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);
}