Ultrasonic sensor HC-SR04 + Blue LCD + L298N H-bridge + Linefollower

Hi everyone, I have litteraly no idea if this is the right way to use the forum but anyway…
I made this program and tested it in class, everything worked out very well, now after 2days when I came home and I tried the program again (after the update to 1.6.4) it keeps saying this thing:

Arduino: 1.6.4 (Windows 8.1), Board:“Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)”

Totaal_programma.ino: In function ‘void loop()’:
Totaal_programma:45: error: ‘microsecondsToCentimeters’ was not declared in this scope
Totaal_programma:67: error: a function-definition is not allowed here before ‘{’ token
Totaal_programma:73: error: a function-definition is not allowed here before ‘return’
‘microsecondsToCentimeters’ was not declared in this scope

I have no idea what’s wrong about the ‘microsecondsToCentimeters’ command but I really need help with this… This is the program:

#include <LiquidCrystal.h>
#define ledPin 17
#define linePin 53
#define vccPin 51
#define leftPin 43
#define rightPin 41

LiquidCrystal lcd(12, 11, 28, 30, 32, 34);

int pingPin = 7; //output 10us pulse to this pin
int inPin = 6; //measure return pulse width from this pin
long duration, inches, cm;
int indec, cmdec;
int inchconv = 147; // ratio between puls width and inches
int cmconv = 59; // ratio between pulse width and cm
String s1,s2;
int dir1PinA = 2;
int dir2PinA = 3;
int speedPinA = 4; // Needs to be a PWM pin to be able to control motor speed

// initialise LCD library and pins
void setup() {
lcd.begin(16, 2);
pinMode(pingPin, OUTPUT);
pinMode(inPin, INPUT);
pinMode(dir1PinA,OUTPUT);
pinMode(dir2PinA,OUTPUT);
pinMode(speedPinA,OUTPUT);
pinMode(linePin,INPUT);
pinMode(vccPin, HIGH);
}
void loop()
{
// Send a short LOW followed by HIGH pulse to Trigger input:
digitalWrite(pingPin, LOW);
delayMicroseconds(2);
digitalWrite(pingPin, HIGH);
delayMicroseconds(10);
digitalWrite(pingPin, LOW);

// read the length of the return pulse on Echo output
duration = pulseIn(inPin, HIGH);
cm = microsecondsToCentimeters(duration);
cmdec = (duration - cm * cmconv) * 10 / cmconv;
s1 = “Object op:”;
s2 = String(cm) + “.” + String(cmdec) + “cm” + " ";
lcd.setCursor(0, 0); // print inches on top line of LCD
lcd.print(s1);
lcd.setCursor(0,1); // print cm on second line of LCD
lcd.print(s2);
delay(100);
if (cm <= 19) {
digitalWrite(ledPin, HIGH);
analogWrite(speedPinA, 0);
digitalWrite(dir1PinA, LOW);
digitalWrite(dir1PinA, LOW);
}
else {
digitalWrite(ledPin, LOW);
analogWrite(speedPinA, 100);
digitalWrite(dir1PinA, LOW);
digitalWrite(dir2PinA, HIGH);
}
long microsecondsToInches(long microseconds)
{
return microseconds / inchconv;
}

long microsecondsToCentimeters(long microseconds)

return microseconds / cmconv;
}

long microsecondsToCentimeters(long microseconds)

  return microseconds / cmconv;
}

Good thing the number of { and } match. Oh, wait. They don’t.

Yes indeed.. That was stupid of me.. Didn't notice that.. But the microsecondsToCentimeters error is still there :(

But the microsecondsToCentimeters error is still there

But your corrected code isn't.

Use code tags

} 
long microsecondsToInches(long microseconds)

Something missing here too.