Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <dht.h>
- #define dataPin 4
- dht DHT;
- void setup() {
- Serial.begin(9600);
- }
- void loop() {
- int readData = DHT.read11(dataPin);
- float t = DHT.temperature;
- float h = DHT.humidity;
- Serial.println("Temperature: ");
- Serial.print(t);
- Serial.print(" ºC");
- Serial.println("Humidity: ");
- Serial.print(h);
- Serial.print(" % ");
- delay(2000);
- }
- // + (levo) na 5V oranžno
- // OUT (srednje) D4 belo
- // - (desno) na GND rjavo
- // https://arduino.stackexchange.com/questions/44898/dht-h-library-not-being-imported
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement