please help me with this error

// Runs the motor (or whatever) to unlock the door.
void triggerDoorUnlock(){
Serial.println("Door unlocked!");
int i=0;

// turn the motor on for a bit.
digitalWrite(lockMotor, HIGH);
digitalWrite(greenLED, HIGH); // And the green LED too.

delay (lockTurnTime); // Wait a bit.

digitalWrite(lockMotor, LOW); // Turn the motor off.

// Blink the green LED a few times for more visual feedback.
for (i=0; i < 5; i++){
digitalWrite(greenLED, LOW);
delay(100);
digitalWrite(greenLED, HIGH);
delay(100);
}

}

// Sees if our knock matches the secret.
// returns true if it's a good knock, false if it's not.
// todo: break it into smaller functions for readability.
boolean validateKnock(){
int i=0;

// simplest check first: Did we get the right number of knocks?
int currentKnockCount = 0;
int secretKnockCount = 0;
int maxKnockInterval = 0; // We use this later to normalize the times.

for (i=0;i<maximumKnocks;i++){
if (knockReadings > 0){

  • currentKnockCount++;*
  • }*
    _ if (secretCode > 0){ //todo: precalculate this._
    * secretKnockCount++;*
    * }*

_ if (knockReadings > maxKnockInterval){ // collect normalization data while we're looping.
maxKnockInterval = knockReadings*;
}
}*_

* // If we're recording a new knock, save the info and get out of here.*
* if (programButtonPressed==true){*
* for (i=0;i<maximumKnocks;i++){ // normalize the times*
secretCode_= map(knockReadings*,0, maxKnockInterval, 0, 100);
}
// And flash the lights in the recorded pattern to let us know it's been programmed.
digitalWrite(greenLED, LOW);
digitalWrite(redLED, LOW);
delay(1000);
digitalWrite(greenLED, HIGH);
digitalWrite(redLED, HIGH);
delay(50);
for (i = 0; i < maximumKnocks ; i++){
digitalWrite(greenLED, LOW);
digitalWrite(redLED, LOW);
// only turn it on if there's a delay*

if (secretCode > 0){
delay( map(secretCode,0, 100, 0, maxKnockInterval)); // Expand the time back out to what it was. Roughly.

* digitalWrite(greenLED, HIGH);
digitalWrite(redLED, HIGH);
}
delay(50);
}
return false; // We don't unlock the door when we are recording a new knock.
}*_

You need to actually tell us what the error message is, but it looks like you might be missing a } at the very end. Post the whole code if it doesn't work, and use the '#' button to make it readable.

There is at least a semantic error that you print that the door is unlocked befor doing anything. The right code on the right place is a good thing....

void triggerDoorUnlock(){
  Serial.println("Door unlocked!");

Error is a mIssing } in validateKnock()