DHT20 Sensor code error

When ever I try to verify my code for my DHT20 sensor I keep getting the same error message.

#include <DHT.h>

#include <DHT20.h>

// Example testing sketch for various DHT humidity/temperature sensors
// Written by ladyada, public domain
#include "Wire.h"
#include "DHT.h"
#define DHTTYPE DHT20   // DHT 20
/*Notice: The DHT10 and DHT20 is different from other DHT* sensor ,it uses i2c interface rather than one wire*/
/*So it doesn't require a pin.*/
DHT dht(DHTTYPE);         //   DHT10 DHT20 don't need to define Pin
 
#if defined(ARDUINO_ARCH_AVR)
    #define debug  Serial
 
#elif defined(ARDUINO_ARCH_SAMD) ||  defined(ARDUINO_ARCH_SAM)
    #define debug  SerialUSB
#else
    #define debug  Serial
#endif
 
void setup() {
 
    debug.begin(115200);
    debug.println("DHTxx test!");
    Wire.begin();
 
    /*if using WIO link,must pull up the power pin.*/
    // pinMode(PIN_GROVE_POWER, OUTPUT);
    // digitalWrite(PIN_GROVE_POWER, 1);
 
    dht.begin();
}
 
void loop() {
    float temp_hum_val[2] = {0};
    // Reading temperature or humidity takes about 250 milliseconds!
    // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
 
 
    if (!dht.readTempAndHumidity(temp_hum_val)) {
        debug.print("Humidity: ");
        debug.print(temp_hum_val[0]);
        debug.print(" %\t");
        debug.print("Temperature: ");
        debug.print(temp_hum_val[1]);
        debug.println(" *C");
    } else {
        debug.println("Failed to get temprature and humidity value.");
    }
 
    delay(1500);
}

This is the error message I keep getting.

Arduino: 1.8.19 (Mac OS X), Board: "Arduino Uno"

/Applications/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -hardware /Users/name/Library/Arduino15/packages -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -tools /Users/name/Library/Arduino15/packages -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/name/Documents/Arduino/libraries -fqbn=arduino:avr:uno -ide-version=10819 -build-path /var/folders/5s/xf_95f193pl88rl3cfz3f6_w0000gn/T/arduino_build_656577 -warnings=none -build-cache /var/folders/5s/xf_95f193pl88rl3cfz3f6_w0000gn/T/arduino_cache_146919 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=/Users/name/Library/Arduino15/packages/arduino/tools/arduinoOTA/1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=/Users/name/Library/Arduino15/packages/arduino/tools/arduinoOTA/1.3.0 -prefs=runtime.tools.avrdude.path=/Users/name/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=/Users/name/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17 -prefs=runtime.tools.avr-gcc.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -verbose /Users/name/Documents/Arduino/sketch_jan28b/sketch_jan28b.ino
/Applications/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -hardware /Users/name/Library/Arduino15/packages -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -tools /Users/name/Library/Arduino15/packages -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/name/Documents/Arduino/libraries -fqbn=arduino:avr:uno -ide-version=10819 -build-path /var/folders/5s/xf_95f193pl88rl3cfz3f6_w0000gn/T/arduino_build_656577 -warnings=none -build-cache /var/folders/5s/xf_95f193pl88rl3cfz3f6_w0000gn/T/arduino_cache_146919 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=/Users/name/Library/Arduino15/packages/arduino/tools/arduinoOTA/1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=/Users/name/Library/Arduino15/packages/arduino/tools/arduinoOTA/1.3.0 -prefs=runtime.tools.avrdude.path=/Users/name/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=/Users/name/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17 -prefs=runtime.tools.avr-gcc.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -verbose /Users/name/Documents/Arduino/sketch_jan28b/sketch_jan28b.ino
Using board 'uno' from platform in folder: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr
Using core 'arduino' from platform in folder: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr
Detecting libraries used...
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard /var/folders/5s/xf_95f193pl88rl3cfz3f6_w0000gn/T/arduino_build_656577/sketch/sketch_jan28b.ino.cpp -o /dev/null
Alternatives for DHT.h: [DHT_sensor_library@1.4.3 Grove_Temperature_And_Humidity_Sensor-master@1.0.0]
ResolveLibrary(DHT.h)
-> candidates: [DHT_sensor_library@1.4.3 Grove_Temperature_And_Humidity_Sensor-master@1.0.0]
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard -I/Users/name/Documents/Arduino/libraries/DHT_sensor_library /var/folders/5s/xf_95f193pl88rl3cfz3f6_w0000gn/T/arduino_build_656577/sketch/sketch_jan28b.ino.cpp -o /dev/null
Alternatives for DHT20.h: [DHT20@0.1.0]
ResolveLibrary(DHT20.h)
-> candidates: [DHT20@0.1.0]
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard -I/Users/name/Documents/Arduino/libraries/DHT_sensor_library -I/Users/name/Documents/Arduino/libraries/DHT20 /var/folders/5s/xf_95f193pl88rl3cfz3f6_w0000gn/T/arduino_build_656577/sketch/sketch_jan28b.ino.cpp -o /dev/null
Alternatives for Wire.h: [Wire@1.0]
ResolveLibrary(Wire.h)
-> candidates: [Wire@1.0]
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard -I/Users/name/Documents/Arduino/libraries/DHT_sensor_library -I/Users/name/Documents/Arduino/libraries/DHT20 -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src /var/folders/5s/xf_95f193pl88rl3cfz3f6_w0000gn/T/arduino_build_656577/sketch/sketch_jan28b.ino.cpp -o /dev/null
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard -I/Users/name/Documents/Arduino/libraries/DHT_sensor_library -I/Users/name/Documents/Arduino/libraries/DHT20 -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src /Users/name/Documents/Arduino/libraries/DHT_sensor_library/DHT.cpp -o /dev/null
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard -I/Users/name/Documents/Arduino/libraries/DHT_sensor_library -I/Users/name/Documents/Arduino/libraries/DHT20 -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src /Users/name/Documents/Arduino/libraries/DHT_sensor_library/DHT_U.cpp -o /dev/null
Alternatives for Adafruit_Sensor.h: [Adafruit_Unified_Sensor@1.1.4]
ResolveLibrary(Adafruit_Sensor.h)
-> candidates: [Adafruit_Unified_Sensor@1.1.4]
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard -I/Users/name/Documents/Arduino/libraries/DHT_sensor_library -I/Users/name/Documents/Arduino/libraries/DHT20 -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src -I/Users/name/Documents/Arduino/libraries/Adafruit_Unified_Sensor /Users/name/Documents/Arduino/libraries/DHT_sensor_library/DHT_U.cpp -o /dev/null
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard -I/Users/name/Documents/Arduino/libraries/DHT_sensor_library -I/Users/name/Documents/Arduino/libraries/DHT20 -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src -I/Users/name/Documents/Arduino/libraries/Adafruit_Unified_Sensor /Users/name/Documents/Arduino/libraries/DHT20/DHT20.cpp -o /dev/null
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard -I/Users/name/Documents/Arduino/libraries/DHT_sensor_library -I/Users/name/Documents/Arduino/libraries/DHT20 -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src -I/Users/name/Documents/Arduino/libraries/Adafruit_Unified_Sensor /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/Wire.cpp -o /dev/null
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard -I/Users/name/Documents/Arduino/libraries/DHT_sensor_library -I/Users/name/Documents/Arduino/libraries/DHT20 -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src -I/Users/name/Documents/Arduino/libraries/Adafruit_Unified_Sensor /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c -o /dev/null
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard -I/Users/name/Documents/Arduino/libraries/DHT_sensor_library -I/Users/name/Documents/Arduino/libraries/DHT20 -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src -I/Users/name/Documents/Arduino/libraries/Adafruit_Unified_Sensor /Users/name/Documents/Arduino/libraries/Adafruit_Unified_Sensor/Adafruit_Sensor.cpp -o /dev/null
Generating function prototypes...
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard -I/Users/name/Documents/Arduino/libraries/DHT_sensor_library -I/Users/name/Documents/Arduino/libraries/DHT20 -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src -I/Users/name/Documents/Arduino/libraries/Adafruit_Unified_Sensor /var/folders/5s/xf_95f193pl88rl3cfz3f6_w0000gn/T/arduino_build_656577/sketch/sketch_jan28b.ino.cpp -o /var/folders/5s/xf_95f193pl88rl3cfz3f6_w0000gn/T/arduino_build_656577/preproc/ctags_target_for_gcc_minus_e.cpp
/Applications/Arduino.app/Contents/Java/tools-builder/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /var/folders/5s/xf_95f193pl88rl3cfz3f6_w0000gn/T/arduino_build_656577/preproc/ctags_target_for_gcc_minus_e.cpp
Compiling sketch...
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard -I/Users/name/Documents/Arduino/libraries/DHT_sensor_library -I/Users/name/Documents/Arduino/libraries/DHT20 -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src -I/Users/name/Documents/Arduino/libraries/Adafruit_Unified_Sensor /var/folders/5s/xf_95f193pl88rl3cfz3f6_w0000gn/T/arduino_build_656577/sketch/sketch_jan28b.ino.cpp -o /var/folders/5s/xf_95f193pl88rl3cfz3f6_w0000gn/T/arduino_build_656577/sketch/sketch_jan28b.ino.cpp.o
/Users/name/Documents/Arduino/sketch_jan28b/sketch_jan28b.ino: In function 'void setup()':
sketch_jan28b:33:9: error: request for member 'begin' in 'dht', which is of non-class type 'DHT(DHT20)'
dht.begin();
^~~~~
/Users/name/Documents/Arduino/sketch_jan28b/sketch_jan28b.ino: In function 'void loop()':
sketch_jan28b:42:14: error: request for member 'readTempAndHumidity' in 'dht', which is of non-class type 'DHT(DHT20)'
if (!dht.readTempAndHumidity(temp_hum_val)) {
^~~~~~~~~~~~~~~~~~~
Multiple libraries were found for "DHT.h"
Used: /Users/name/Documents/Arduino/libraries/DHT_sensor_library
Not used: /Users/name/Documents/Arduino/libraries/Grove_Temperature_And_Humidity_Sensor-master
Using library DHT_sensor_library at version 1.4.3 in folder: /Users/name/Documents/Arduino/libraries/DHT_sensor_library
Using library DHT20 at version 0.1.0 in folder: /Users/name/Documents/Arduino/libraries/DHT20
Using library Wire at version 1.0 in folder: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire
Using library Adafruit_Unified_Sensor at version 1.1.4 in folder: /Users/name/Documents/Arduino/libraries/Adafruit_Unified_Sensor
exit status 1
request for member 'begin' in 'dht', which is of non-class type 'DHT(DHT20)'

(just so you know for anyone helping me I change everything that said my name in it to name to stay Anonymous)

Does anyone have any ideas of how I could fix this?

Thank you

Which one do you really want?

it does not matter to me as long as it works with the grove dht20 sensor.

also when I try it on the web editor it give me this error

/usr/local/bin/arduino-cli compile --fqbn arduino:megaavr:uno2018:mode=on --libraries /home/builder/opt/libraries/latest --build-cache-path /tmp --output-dir /tmp/419089244/build --build-path /tmp/arduino-build-CEFAC3168AE69F542495779D11D2DCCA /tmp/419089244/sketch_jan28a

Using library Wire at version 1.0 in folder: /home/builder/.arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/Wire

Using library adafruit_unified_sensor_1_1_4 at version 1.1.4 in folder: /home/builder/opt/libraries/adafruit_unified_sensor_1_1_4

/tmp/419089244/sketch_jan28a/sketch_jan28a.ino: In function 'void setup()':

/tmp/419089244/sketch_jan28a/sketch_jan28a.ino:33:9: error: request for member 'begin' in 'dht', which is of non-class type 'DHT(DHT20)'

dht.begin();

^~~~~

/tmp/419089244/sketch_jan28a/sketch_jan28a.ino: In function 'void loop()':

/tmp/419089244/sketch_jan28a/sketch_jan28a.ino:42:14: error: request for member 'readTempAndHumidity' in 'dht', which is of non-class type 'DHT(DHT20)'

if (!dht.readTempAndHumidity(temp_hum_val)) {

^~~~~~~~~~~~~~~~~~~

Error during build: exit status 1

thank you for helping

My advice is pick one of the libraries, and use only the examples that come with it.

(I'm not a big fan of the DHT devices)

OK thank you

let me check if that works

When I tried the code it did not work

this is the example code

//#define DHTPIN 3 // By default its connected to pin D3, it can be changed, define it before the #include of the library
#include "Arduino_SensorKit.h"

void setup() {
  Serial.begin(9600);
  Environment.begin();
}

void loop() {
  Serial.print("Temperature = ");
  Serial.print(Environment.readTemperature()); //print temperature
  Serial.println(" C");
  Serial.print("Humidity = ");
  Serial.print(Environment.readHumidity()); //print humidity
  Serial.println(" %");
  delay(2000);
}

but how would I define it for a I2C port instead of a DHTPIN?

What do you mean?

OP is using a I2C version of the sensor, like this one below:

image

Sounds like he is trying to use a common DHT library (Wire.h based) to get data via I2C, which is not a good idea.

So, he might pick the correct library (the best option would be the one that is provided by the manufacturer), and use an example that shows how to get data from the I2C version of the sensor.

Could you tell us what is the sensor that you have (with manufacturer) and how you´re connecting it to your Arduino? (which Arduino by the way?)

I got the grove sensor kit and they upgrade the sensor in it to a DHT20 from seeed. I am am trying to use a Arduino uno wifi rev2. To be able to send the data to Thingspeak.

Ok, so at this page --> https://wiki.seeedstudio.com/Grove-Temperature-Humidity-Sensor-DH20/

you get the code you need, which is the one that you actually used at first. The same page also has the library (Grove_Temperature_And_Humidity_Sensor-master). So, now you need to get rid of any other DHT library that you have, so that Arduino can use the correct one.

In the given example they are connecting the module to a Grove Shield not directly to Arduino. Since you didn´t provide the connections that you have, I´m assuming they´re correct...

when I try that I get this message.

xit status 1
request for member 'begin' in 'dht', which is of non-class type 'DHT(DHT20)'

and it highlights this in red. dht.begin();

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.