Go Down

Topic: DHT library issue (Read 218 times) previous topic - next topic


Oct 23, 2018, 07:54 pm Last Edit: Oct 23, 2018, 09:30 pm by ballscrewbob Reason: was hijacked
Hi, i am getting the follow error when i try to use library DTH.h in online IDE

Coul anyone help me  ?

i already import the DTH.h library

Using library DHT in folder: /tmp/262419300/custom/DHT (legacy)

/tmp/262419300/sketch_oct23b/sketch_oct23b.ino:9:1: error: 'DHT' does not name a type

/tmp/262419300/sketch_oct23b/sketch_oct23b.ino: In function 'void setup()':

/tmp/262419300/sketch_oct23b/sketch_oct23b.ino:15:4: error: expected unqualified-id before '.' token

exit status 1

My code:
#include <dht.h>

#define DHTPIN 2     // what digital pin we're connected to

// Uncomment whatever type you're using!
#define DHTTYPE DHT11   // DHT 11

void setup() {
 Serial.println("DHTxx test!");


void loop() {

Go Up