Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
12
from machine import Pin
import random
led = Pin(2, Pin.OUT)
temp = random.randint(25,35)
light = random.randint(0,100)
if temp>30 or light<50:
led.value(1)
print("LED ON")
else:
led.value(0)
print("LED OFF")
print(f"Temp: {temp}, Light: {light}")Coding works best on desktop or with an external keyboard.