Loop with condition

Your code does absolutely nothing unless the input is HIGH... all the code is buried in an 'if' statement.