#define DHT_PIN PD13

#include <DHT22.h>



DHT sensor(DHT_PIN,DHT22);

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Serial.println("Hello, STM32!");

  sensor.begin();
}

void loop() {

  int res = sensor.read();

  if(res == 0) {
    float temp = sensor.readTemperature();
    Serial.println(temp);
  }
  // put your main code here, to run repeatedly:
  delay(10); // this speeds up the simulation
}
Loading
st-nucleo-c031c6