Code problem with LED

  int inputPin = 14;               // choose the input pin (for PIR sensor)
  int pirState = LOW;             // we start, assuming no motion detected

Do you have an input connected to pin 14? No, you don't, at least not according to the comments. So the variable name is misleading, which appears to be the source of your problems.

Use a meaningful name, like pirPin. Then,

val = digitalRead(pirState); //read input and store it

Will be obvious that you are reading the wrong pin. In the () should be pirPin. val is useless, to. You really want:

pirState = digitalRead(pirPin);