import time,machine,random
from machine import Pin,I2C , SoftI2C
from pico_i2c_lcd import I2cLcd
i2c = SoftI2C(sda = Pin(20) , scl = Pin(27) , freq = 40000)
lcd_address = i2c.scan()[0]
lcd = I2cLcd(i2c , lcd_address,2,16)
# print(lcd_address)
while True:
a = random.randint(0,361)
print(a)
lcd.clear()
lcd.move_to(0,0)
lcd.putstr("Wind Direction:")
lcd.move_to(0,1)
if a<90:
lcd.putstr("NorthEasterly")
elif (a>90) and (a<180):
lcd.putstr("NorthWesterly")
elif a>180 and a<270:
lcd.putstr("SouthWesterly")
else:
lcd.putstr("NorthWesterly")
time.sleep(2)
# In Question 2 time NorthWesterly is given...Check