print("Let's make external LED Blink")
print("21/11/2023")
print("created by ZUNIE")
#import libraries
from machine import Pin
from utime import sleep
import os
#Pin declaration
built_in_LED = Pin(2, Pin.OUT) #(gpio pin no2 to make led blink)
purple_LED = Pin(12, Pin.OUT)
built_in_LED = Pin(2, Pin.OUT)
yellow_LED = Pin(13, Pin.OUT)
print ('This program will ask you to guess a correct number')
print("========INSTRUCTION TO YOU===========")
target = int(input("ENTER YOUR FAV NUMBER FROM 1-9999"))
while True:
# obtain input from the user:
value = int(input("Enter an integer between 1 and 9999:"))
for a in range (3):
if value > target:
purple_LED.on()
sleep(0.5)
purple_LED.off()
sleep(0.5)
yellow_LED.off()
print("WRONG!", value, "is high/too high")
elif int(value) < target:
purple_LED.on()
sleep(0.5)
purple_LED.off()
sleep(0.5)
yellow_LED.off()
print("WRONG!", value, "is low/too low")
else:
purple_LED.off()
yellow_LED.on()
sleep(0.5)
yellow_LED.off()
sleep(0.5)
print("Perfect! Kudos!")
break