//#include <ESP32Servo.h>
//#include <dummy.h>
#include <LiquidCrystal.h>
int Contrast=30;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int rawValue;
int offset = 40;
int fullScale = 922;
float pressure;
void setup() {
// put your setup code here, to run once:
analogWrite(6,Contrast);
lcd.begin(16,2);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
rawValue = analogRead(A0);
Serial.print(“Raw A/D is”);
Serial.print(rawValue);
lcd.setCursor(0,0); // Sets the cursor to col 0 and row 0
lcd.print(“Raw: “); // Prints Sensor Val: to LCD
lcd.print(rawValue); // Prints value on Potpin1 to LCD
pressure = (rawValue – offset) * 500.0 / (fullScale – offset); // pressure conversion
Serial.print(“The pressure is “);
Serial.print(pressure, 1); // one decimal place
Serial.println(“kPa”);
lcd.setCursor(0,1); // Sets the cursor to col 1 and row 0
lcd.print(“Pres(KPa): “); // Prints Sensor Val: to LCD
lcd.print(pressure); // Prints value on Potpin1 to LCD
delay(500);
}