Issues with love-o-meter coding

can someone please help me with the coding of this please because i am new to this and i copied the code straight from the book so i dont really know what the problem is. it is saying that “AO” has not been declared in this scope. the code pasted below

const int sensorPin = AO;
const float baselineTemp = 20.0;
void setup(){
Serial .begin(9600);//open a serial port
for (int pinNumber = 2; pinNumber<5; pinNumber++){
pinMode(pinNumber,OUTPUT);
digitalWrite(pinNumber,LOW);
}
}
void loop(){
int sensorVal = analogRead(sensorPin);
Serial.print(“Sensor Value:”);
Serial print(sensorVAl);
//convert the ADC reading to voltage
float voltage = (sensorVal/1024…0) *5,0;
Serial.print(",Volts:");
Serial.print(voltage);
Serial.print(",degress C:");
/converts the voltage to temperature in degress celsius
float temperature = (voltage - .5) *100;
Serial.print1n(remperature)
if(temperature < baselineTemp){
digitalWrite(2,LOW);
digitalWrite(3,LOW);
digitalWrite(4,LOW);
}else if (temperature >= baselineTemp+2 &&
temperature < baselineTemp+4){
digitalWrite(2,HIGH)
digitalWrite(3,LOW)
digitalWrite(4,LOW)
}else if(temperaure >= baselineTemp +4 &&
temperature < baselineTemp+6){
digitalWrite(2,HIGH);
digitalWrite(3,HIGH);
digitalWrite(4,LOW);
}else if(temperature >=baseline +6){
digitalWrite(2,HIGH);
digitalWrite(3,HIGH);
digitalWrite(4,HIGH);
}
delay(1);
}

If you have written A0 as an int, you have found your problem. Change it to:

const int sensorPin = 0;

And it should work. In your loop the row

int sensorVal = analogRead(sensorPin);

takes sensorPin as an argument and it has to be an integer.

matthew7297: const int sensorPin = AO;

Change your O to 0

mmolder: If you have written A0 as an int, you have found your problem. Change it to:

const int sensorPin = 0;

And it should work. In your loop the row

int sensorVal = analogRead(sensorPin);

takes sensorPin as an argument and it has to be an integer.

i did that but it says O has not been declared in this scope

Not the letter 'o', but the digit zero '0'