import machine
led = machine .Pin(15, machine.Pin.OUT)
while True:
user_input = input("Enter 'on' to turn LED on, 'off' to turn LED off, or 'quit' to stop: ").strip().lower()
if user_input == 'on':
led.value(1)
print("LED is ON")
elif user_input == 'off':
led.value(0)
print ("LED is OFF")
elif user_input == 'quit':
print("Exiting the program.")
break
else:
print("Invalid input!")