print("Hello, ESP32\n")
print("this program is to test the built-in LED blinking on ESP32\n")
print("Remarks: observe the BLUE LED on the board")
from machine import Pin
from utime import sleep #utime since upython is used
led_red = Pin(14,Pin.OUT) #built-in LED is connected to Pin 14
led_green = Pin(32,Pin.OUT) #built-in LED is connected to Pin 32
target = 66
while True : #forever loop
# obtain input from the user:
value = int(input("Enter an integer between 1 and 100: "))
if value > target:
print("WRONG!", value, "is high/too high")
led_green.on()
led_red.off()
elif int(value) < target:
print("WRONG!", value, "is low/too low")
led_green.on()
led_red.off()
else:
print("Perfect! Kudos!")
led_green.off()
led_red.on()
break