#finite loop
#print number from 1 -10 using a for loop
#print("loop starting")
#for i in range (1,11):
# print (i)
#print ("Loop Finished")
#infinite loop
#print numbers from 1 to infinity
#num = 0
#while True:
# num = num + 1
# print (num)
#print ("Loop Finished")
#Create delays in mins, seconds and microseconds
#import time # imports the time module/library
#time.sleep(1) #delay for 1 second
#time.sleep_ms(500) #delay for milliseconds
#time.sleep_us(10) #delay for microseconds
#Creaate a delay counter
#start = time.ticks_ms() #get millisecond counter
#time.sleep_ms(100) #delay for 100 milliseconds
#compute the time difference
#delta = time.ticks_diff(time.ticks_ms(), start)
#
#print("Time difference is", delta, "millisecond")
# Condition statement
#import time
#threshold_temp = 40
#threshold_humidity = 70
#for i in range (45):
#time.sleep_ms(500) # delay each iteration
#print (i) #print the value of i
#if i > threshold_temp : # compare i value in threshold_temp
# print ("High Temperature")
#control pico onboard LED
#import modules
from machine import Pin
from time import sleep
#configure the led pin
led = Pin(15, Pin.out)
button = Pin(14, Pin.IN, Pin.PULL_DOWN)
while True:
if button.value()==1:
led () # turn on the LED
sleep(0.2)
led() #turn off LED
sleep (0.2)