// LCD1602 and Pi Pico!
#include <DHT.h>
#include <LiquidCrystal.h>
int pin =3;
DHT dht(pin,DHT22);
LiquidCrystal lcd(12, 11, 10, 9, 8, 7);
void setup() {
lcd.begin(16, 2);
lcd.print("Hello SVECW!");
Serial.begin(115200);
Serial.print("DHT22 Example...");
dht.begin();
}
void loop() {
float temp =dht.readTemperature();
float humd =dht.readHumidity();
if(isnan(temp) || isnan(humd)){
Serial.println("Failed to read values from DHT sensor");
return;
}
lcd.setCursor(0,1);
lcd.print(temp);
lcd.print("\xdf");
lcd.print("C");
lcd.setCursor(10,1);
lcd.print(humd);
lcd.print("%");
Serial.print("Humidity : ");
Serial.print(humd);
Serial.print("% Temperature : ");
Serial.print(temp);
Serial.println("°C");
delay(1); // Adding a delay() here speeds up the simulation
}
pico:GP0
pico:GP1
pico:GND.1
pico:GP2
pico:GP3
pico:GP4
pico:GP5
pico:GND.2
pico:GP6
pico:GP7
pico:GP8
pico:GP9
pico:GND.3
pico:GP10
pico:GP11
pico:GP12
pico:GP13
pico:GND.4
pico:GP14
pico:GP15
pico:GP16
pico:GP17
pico:GND.5
pico:GP18
pico:GP19
pico:GP20
pico:GP21
pico:GND.6
pico:GP22
pico:RUN
pico:GP26
pico:GP27
pico:GND.7
pico:GP28
pico:ADC_VREF
pico:3V3
pico:3V3_EN
pico:GND.8
pico:VSYS
pico:VBUS
lcd:VSS
lcd:VDD
lcd:V0
lcd:RS
lcd:RW
lcd:E
lcd:D0
lcd:D1
lcd:D2
lcd:D3
lcd:D4
lcd:D5
lcd:D6
lcd:D7
lcd:A
lcd:K
r1:1
r1:2
dht1:VCC
dht1:SDA
dht1:NC
dht1:GND