Go Down

Topic: compilation error with DHT11 (Read 117 times) previous topic - next topic

CharlyBrown

Hi Guys.
I have a problem with dht library by Adafruit, version 1.1.1 and 1.1.0.

I try with many libs, and I have the same problem ever.

I using a Arduino DUE, with Arduino 1.65 IDE.
I await your comments.


Quote
C:\Users\charly\Documents\Arduino\libraries\DHT_sensor_library\DHT.cpp: In constructor 'DHT::DHT(uint8_t, uint8_t, uint8_t)':
C:\Users\charly\Documents\Arduino\libraries\DHT_sensor_library\DHT.cpp:14:9: error: invalid conversion from 'Pio*' to 'uint8_t {aka unsigned char}' [-fpermissive]
   _port = digitalPinToPort(pin);
         ^
Error de compilaciĆ³n
 
Quote
Sketch:

// include the library code:
#include <LiquidCrystal.h>
#include <DHT.h>

//-------{PINES}-----------

const int tempSensor = 35;

#define DHTPIN 7
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);

void setup() {
Serial.begin(9600);
dht.begin();
}
void loop() { 
int h = dht.readHumidity();// Lee la humedad
int t= dht.readTemperature();//Lee la temperatura
}
Regards

Peter_n

Are you sure that library is also for the Due ?

robtillaart

Try this version - https://github.com/RobTillaart/Arduino/tree/master/libraries/DHTstable
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

CharlyBrown

thaks Rob, now works fine!

Best regards.

robtillaart

Good to hear it still works on the DUE :)
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Go Up