Parallax Help! **Title change: Parallax Code!**

Hey guys, I’m a newbie and I wrote my first code for the Parallax Ping. Can you tell me what’s wrong? It keeps saying “at this point in file” in the error box. Thanks! Here is the code:

int signal=12;
int ledPin=11;
int distance;
unsigned long pulseduration=0;

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

void measureDistance()
{
  pinMode(signal, OUTPUT);
  digitalWrite(signal, LOW);
  delayMicroseconds(5);
  digitalWrite(signal, HIGH);
  delayMicroseconds(5);
  digitalWrite(signal, LOW);
  pinMode(signal, INPUT);
  
  pulseduration=pulseIn(signal, HIGH);
}

void loop()
{
  measureDistance();
  
  if(pulseduration <=10)
  {
    digitalWrite(ledPin=HIGH);
  }
}

Wait actually, sorry. I just did the digital pin thing wrong. But can anyone still tell me if this is correct?

Actually, don’t reply to this. I fixed it. The code works. Hey newbies out there like me!!! You can use this version of the code. It works. What it does is that is an object is 10 cm or closer to the ping, then the led on pin 13 lights up. Otherwise, it stays out. Here is the code. Oh yeah and you experts out there! Please tell me any way to improve this code!

int signal=12;
int ledPin=13;
int distance;
unsigned long pulseduration=0;

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

void measureDistance()
{
  pinMode(signal, OUTPUT);
  digitalWrite(signal, LOW);
  delayMicroseconds(5);
  digitalWrite(signal, HIGH);
  delayMicroseconds(5);
  digitalWrite(signal, LOW);
  pinMode(signal, INPUT);
  
  pulseduration=pulseIn(signal, HIGH);
}

void loop()
{
  measureDistance();
  pulseduration=pulseduration/2;
  distance = int(pulseduration/29);
  
 Serial.print("Distance - ");
 Serial.println(distance);
 delay(500);
 
  if(distance <= 10)
  {
    digitalWrite(ledPin, HIGH);
  }
  
  if(distance > 10)
  {
    digitalWrite(ledPin, LOW);
  }
}

That works just fine!