from microbit import *
import random
weather_forecasts = [
"Sunny with a high of 25°C",
"Cloudy with a chance of rain",
"Rain showers expected",
"Clear skies tonight",
"Stormy weather approaching",
"Snow likely in the evening",
"Partly cloudy with mild temperatures",
"High winds throughout the day",
"Foggy conditions in the morning",
"Thunderstorms in the afternoon",
]
while True:
display.show(Image.CLOUD)
if accelerometer.was_gesture("shake"):
display.clear()
sleep(1000)
display.scroll(random.choice(weather_forecasts))
Copyright ⓒ TECH79 All right reserved