No encuentro el error/ I can't find the mistake

so to explain what the code above does - it's what you described as the intended behavior

if input doesn't detects voltage, is low, led turns off

but that you did not put into code