help with alarm code

  if (ledState == HIGH)
    ...

Your code never reads or changes ledState.