you can post code between [ code] (without space) tags by using the #button above the edit field
unsigned long time;
void setup ()
{
Serial.begin(9600);
pinMode(7,INPUT);
}
void loop ()
{
time = pulseIn(7,LOW);
if (time > 0)
{
Serial.println(time);
}
}
Which version of the IDE are you using ? 1.0 or 0.22 ?
How did you connect the photogate ? Please post schematics?