Closed
Description
Hi, I am trying to use the DHT22 temperature and humidity sensor with RP2040, and I want to simulate the sensor.
I am hoping to find some guidance on how to simulate the DHT22 sensor and use it with RP2040 to read temperature and humidity. I have attached my current Arduino code below:
#include "DHT.h"
#define GPIOPIN 2
#define DHTTYPE DHT22
DHT dht(GPIOPIN, DHTTYPE);
void setup() {
Serial1.begin(9600);
dht.begin();
}
void loop() {
delay(200);
float h = dht.readHumidity();
float t = dht.readTemperature();
Serial1.print("Humidity: ");
Serial1.print(h);
Serial1.print("% Temperature: ");
Serial1.print(t);
Serial1.println("°C");
}
I have seen DHT22 on both wokwi-elements and the Wokwi platform, but I am not sure how it interacts with RP2040.
Thank you very much for your help!
Metadata
Metadata
Assignees
Labels
No labels