Skip to content

Instantly share code, notes, and snippets.

@ProfAndreaPollini
Created January 8, 2025 12:44
Show Gist options
  • Save ProfAndreaPollini/8df2150d7a8de79d60589780c89f6832 to your computer and use it in GitHub Desktop.
Save ProfAndreaPollini/8df2150d7a8de79d60589780c89f6832 to your computer and use it in GitHub Desktop.
arduino temperature reader
#include "DHT.h"
DHT dht(2,DHT11);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
dht.begin();
}
void loop() {
// put your main code here, to run repeatedly:
float t = dht.readTemperature();
Serial.println(t);
delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment