from machine import Pin
from time import sleep
from sys import exit
sleep(0.1) # Wait for USB to become ready
LED1 = Pin(2, Pin.OUT)
LED2 = Pin(3, Pin.OUT)
while True:
print("Use 5 or 4")
inp = input("Which pin do you want to turn on? ")
if (inp == "4"):
ActPin = LED1
else:
if (inp == "5"):
ActPin = LED2
else:
print("Pin not inputed!")
exit()
print("Turn pin On or Off?")
inp = input("Choose: ")
if ((inp == "On") or (inp == "1")):
ActPin.on()
else:
if ((inp == "Off") or (inp == "0")):
ActPin.off()
else:
print("Could not turn",ActPin,"to",inp,"!")
exit()