TTL Pulse Selection Program Problem

I have posted a number of times before about this subject, and everyone has been very helpful. I finished writing the code which I thought would do what I wanted, but unfortunately it is not. The setup is the following 'circuit': a spectrometer hooked up to to digital pin 2 (on the arduino uno) via the spectrometer's lamp enable pin (sends out TTL active HIGH) and then digital pin 3 on the arduino is the output to an LED controller which has a trigger-in pin (pin 3 on arduino is connected to trigger-in pin). Lastly the trigger-out pin on the LED controller is connected to the GND (ground) pin on the spectrometer. What I want the code to do is take in the first TTL (a 5V pulse) sent from the spectrometer and then ignore all the rest until the reset button is hit. What it is doing now is when I run the code, it starts the LED software pattern without taking in a TTL (so if I make the LED controller programmed so it turns on the LED for 5 seconds and then off, when I hit the reset button on the arduino that pattern executes, and the LED goes on). Here is my code - I'm not sure why it's not doing what I'd hoped it to do - thanks for the help!

int inputpin = 2;
int outputpin = 3;
void setup()
{
pinMode(inputpin,INPUT);
pinMode(outputpin,OUTPUT);
digitalWrite(outputpin,LOW);
}
void loop()
{
while(digitalRead(inputpin)==2){}
digitalWrite(outputpin,HIGH);
delayMicroseconds(10);
digitalWrite(outputpin,LOW);
while(3){}
}

What do you expect this line to do?

while(digitalRead(inputpin)==2){}

This is an endless loop (dead lock):

while(3){}

Code:
while(digitalRead(inputpin)==2){}

I want this above line to establish that while the TTL pulse comes to the input pin (2), then send the TTL through to the LED controller.

This is an endless loop (dead lock):
Code:
while(3){}

The endless loop is meant to just ignore the TTL pulses sent after the first one - at least, that's what I wanted it to do. Does it not do that? If not, how would I go about doing that?

while(digitalRead(inputpin)==2){}

is equal to

while (0) {}

and it does absolutely nothing except wasting CPU cycles. digitalRead() returns LOW or HIGH and both are not equal to 2 (at least in the versions of the IDE I saw).

A

while (digitalRead(inputpin));

does wait as long as pin 2 is HIGH. If I understood you correctly that's what you want.

A

while(1); // wait till reset is hit

does the same as your version with the 3 but it's more clear what your intension was.

singha:
Code:
while(digitalRead(inputpin)==2){}

I want this above line to establish that while the TTL pulse comes to the input pin (2), then send the TTL through to the LED controller.

This is an endless loop (dead lock):
Code:
while(3){}

The endless loop is meant to just ignore the TTL pulses sent after the first one - at least, that's what I wanted it to do. Does it not do that? If not, how would I go about doing that?

You may get more responses, and more help, if you do this -

When you post your code put it between ... tags. You can do that by highlighting your code & clicking the # button above the posting area.