Error message I don't understand

Hello,

I have made what I thought was a working code but I keep getting an error message.

Heres the code

#include <LiquidCrystal.h>;
unsigned long startTime;
unsigned long stopTime;
unsigned long elapsedTime; 
unsigned long Time;
boolean started = false;
boolean stopped = false;
int startPin = 9;                 
int stopPin = 8;
const int numRows = 2;
const int numCols = 16;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup()
{
pinMode(stopPin, INPUT); 
pinMode(startPin, INPUT);
 digitalRead;
  Serial.begin(9600);
 {
   
void loop();
{
  
   if(digitalRead(startPin) == HIGH) // The sensor has been activated
{
   started = true;         // If this is ture start the timer
   startTime = micros(); // States when the senor has been crossed
} 

  if(digitalRead(stopPin) == HIGH) // The sensor has been activated
{
   stopped = true;         // If this is ture start the timer
   stopTime = micros(); // States when the senor has been crossed
} 
if(started && stopped)
{
   elaspedTime = stopTime - startTime; // How long did that take?
   Serial.print("Elapsed time, in microseconds: ");
   Serial.println(elapsed);

   started = false;  // Reset so the senors can be tripped again
   stopped = false;
} 
Serial.print("Elapsed time, in seconds: ");
lcd.print("Elapsed time, in seconds: ");

The error message is
In function ‘viod setup()’ :
error: 'elaspedTime ’ was not declared in this scope

What does this mean and how do I fix it?

Cheers
Bye

  Serial.begin(9600);
 {

Closing bracket the wrong way round.

void loop();

No semicolon here.

Thank you

But now I’m getting another error

void loop();
{
if(digitalRead(startPin) == HIGH) // The sensor has been activated
{

At the high lighted section I’m getting the error
error: expected unqualified-id before ‘{’ token

What should I do?

Remove the semicolon after void loop()

(and read a C programming tutotial :wink: )

RIght OK, that worked but now I getting the same message as before in relation to the eplasped time.

elaspedTime

You have written elapsed in three different ways, in this thread.
Check your typing :wink:

I should learn to read, well its working now thank you a great deal for the help. :slight_smile: