Loop with condition

via a 10k resistor.