sensorPin was not declared in this scope!

Hello, i am coding a portable thermometer with a LM35 sensor and 9v battery on an Uno board.

I keep getting sensorPin was not declared in this scope error and ive tried loads of variations through search forums and ive checked other similar code but i still cant get it to verify correctly, any help is appreciated!

void setup() {
// put your setup code here, to run once:
#include<LiquidCrystal.h>

LiquidCrystal Lcd(12, 11, 5, 4, 3, 2);
const int (sensorPin) = A1;
int sensorValue = analogRead(A1);
Lcd.begin(16, 2); //LCD is 1602, this means 16 columns and 2 rows
Lcd.setCursor(0,0);
Lcd.print (" Temperature ");
Lcd.setCursor(0,1);
Lcd.print( " Celsius Farenhait ");
delay(1000);
Lcd.clear();
}

void loop() {
// put your main code here, to run repeatedly:
int value = analogRead(sensorPin);
Lcd.setCursor(0,0);
float millivolts = (value / 1024.0)*5000;
float Celsius = millivolts / 10;
Lcd.print (Celsius);
Lcd.print (" degrees Celcius ");

Lcd.print ((Celsius*1.8)+32);
Lcd.print (" degrees Farenhait ");

delay(400); //Temperature at given time will be displayed for 0.4th of a second before a new updated value will be displayed
Lcd.clear();
}

Hi!

Firstly, please use [code ] tags when posting code, it makes it easier to read.

Secondly,

you want to put this part:

#include<LiquidCrystal.h>

LiquidCrystal Lcd(12, 11, 5, 4, 3, 2);
const int (sensorPin) = A1;

outside your setup(). These are global variables. Right now they are scoped only to your setup(), and therefore cannot be used in loop(). If you're interested (hint: you should be!), look up how scoping works in c++.

Thank you so much! That was driving me insane for days!