import time
import machine
from dht import DHT22

#We performed the simulation with DHT22 because LM35 sensor is not available on Wokwi.

dht = DHT22(22)

rgb_r = machine.Pin(21, machine.Pin.OUT)
rgb_g = machine.Pin(20, machine.Pin.OUT)
rgb_b = machine.Pin(19, machine.Pin.OUT)

while True:
    rgb_r.high()
    rgb_g.high()
    rgb_b.high()
    dht.measure()
    tempC = dht.temperature()
#Common Anode RGB is used  
    if(tempC > 25):
        rgb_r.low()
        rgb_g.high()
        rgb_b.high()   
        
    if(tempC > 0 and tempC <= 25):
        rgb_r.high()
        rgb_g.low()
        rgb_b.high()   
        
    if(tempC <= 0):
        rgb_r.high()
        rgb_g.high()
        rgb_b.low()   
        
    
    
    print("Temperature: ",tempC, "°C", sep=" ")
    time.sleep(2)


$abcdeabcde151015202530fghijfghij
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT