i am trying to connect my lcd display to my pressure sensor and i keep getting error message “sensorpin not declared in this scope” can you help me out
code is as follows
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7,8,9,10,11,12);
int potPin1 = A1;
int potPin2 = A2;
void setup()
{
// set up the LCD’s number of columns and rows:
lcd.begin(16, 2);
lcd.clear();
pinMode(potPin1, INPUT);
pinMode(potPin2, INPUT);
// declare the ledPin as an OUTPUT:
Serial.begin(9600);
}
void loop()
{
lcd.setCursor(0,0); // Sets the cursor to col 0 and row 0
lcd.print("SensorVal1: "); // Prints Sensor Val: to LCD
lcd.print(analogRead(potPin1)); // Prints value on Potpin1 to LCD
lcd.setCursor(0,1); // Sets the cursor to col 1 and row 0
lcd.print("SensorVal2: "); // Prints Sensor Val: to LCD
lcd.print(analogRead(potPin2)); // Prints value on Potpin1 to LCD
int i=0;
int sum=0;
int offset=0;
Serial.println(“init…”);
for(i=0;i<10;i++)
{
int sensorValue = analogRead(sensorPin)-512; //
sum+=sensorValue;
}
offset=sum/10.0;
Serial.println(“Ok”);
while(1)
{
int sensorValue = analogRead(sensorPin)-offset; //
Vout=(5sensorValue)/1024.0;
P=Vout-2.5;
Serial.print("Presure = " );
Serial.print(P1000);
Serial.println(“Pa”);
delay(1000);
}
}
thanks for your help