serial was not declared in this scope

hi im new to arduino and im just trying to practice coding to bulid up to a proper project, but when i try to verify this code it tells me thst " 'serial' was not declared in this scope" can anyone help me? i have also attatched a copy of the program, many thanks

#include <SoftwareSerial.h>
const int analogPin = A0;
const int ledPin = 13;
const int threshold = 400;

void setup() {
pinMode (ledPin, OUTPUT);
serial.begin(9600);
}

void loop() {
int analogValue = analogRead (analogPin);
if (analogValue > threshold; {
digitalWrite (ledPin, HIGH);
}
else {
digitalWrite (ledPin, LOW);
}
serial.println (analogValue);
delay(2);
}

ANALOGUE_INPUT_PRACTICE.ino (466 Bytes)

sp. "Serial"

Capital S. C is case sensitive.

Also, no need to include SoftwareSerial unless using it to create an additional "software" serial port on different pins for communicating with other devices (other than the computer its usb port is connected to)

ok thank you i managed to fix that, but now its saying that there is no if statement bec#fore the else statement and im confused because i have put an if statement first

@lexa397 created a new topic for the "no if statement bec#fore the else statement" problem, where it has been resolved:
https://forum.arduino.cc/index.php?topic=664306