Hi @Johan_Ha
The "Arduino_Sensorkit" library has a dependency on the "Grove Temperature And Humidity Sensor" library for its DH20 sensor support. This library contains a header file named DHT.h and the "Arduino_Sensorkit" library has an #include directive for that file.
As indicated by this message, you have two libraries installed on your computer which contain the header file DHT.h:
Under these conditions, the Arduino sketch build system must decide which of the two libraries to use. The sophisticated algorithm is usually able to pick the right one, but not always. Unfortunately this is a case where it picked the wrong library of the two.
So you will need to force the Arduino build system to use the correct library. Different techniques are available for doing this with Arduino IDE and Arduino Cloud, so I'll provide separate advice for each:
Arduino IDE
If you aren't using the "DHT sensor library" library in any of your other sketches, the simple solution will be to uninstall it. Once that is done the build system will correctly use the "Grove Temperature And Humidity Sensor" library.
If you aren't sure why the "DHT sensor library" is installed on your computer in the first place, the explanation is probably that older versions of the "Arduino_Sensorkit" library actually had a dependency on the "DHT sensor library" instead of "Grove Temperature And Humidity Sensor". The Arduino IDE Library Manager automatically installs the dependencies of a library along with the library, so previously installing "Arduino_Sensorkit" also installed "DHT sensor library", setting up the very conditions that make it painful to use the latest version of "Arduino_Sensorkit"
. The "Arduino_Sensorkit" library no longer has a dependency on "DHT sensor library", so uninstalling "DHT sensor library" won't cause any harm.
I'll provide instructions you can follow to uninstall the "DHT sensor library":
- Select Sketch > Include Library > Manage Libraries... from the Arduino IDE menus to open the "Library Manager" view in the left side panel.
- In the "Filter your search" field, type
DHT sensor library
- Scroll down through the list of libraries until you see the "DHT sensor library" entry.
- Hover the mouse pointer over the "DHT sensor library" entry.
- You will see a ●●● icon appear near the top right corner of the library entry. Click on that icon.
A context menu will open.
- Select "Remove" from the context menu.
An "Uninstall" dialog will open.
- Click the "YES" button in the "Uninstall" dialog to confirm that you want to uninstall the library.
- Wait for the uninstall process to finish.
Arduino Cloud
Every one of the thousands of libraries in the Arduino Library Manager are pre-installed in Arduino Cloud. Since the "DHT sensor library" is in Library Manager, this means the problematic conditions are in place in Arduino Cloud from the start.
Library Manager libraries are installed for all users in Arduino Cloud, so the technique of uninstalling the unused problematic library is not available to us there as it was when using Arduino IDE. So a different technique is used in this case:
- If it is not already open, select "Libraries" from the menu on the left side of the "Arduino Web Editor" window to open the Libraries panel.
- Click the "LIBRARY MANAGER" button in the Libraries panel.
- Type
Grove Temperature And Humidity Sensor in the "SEARCH LIBRARY" field.
- If it is not already favorited, click the ☆ icon ("Favorite Library") at the right of the "Grove Temperature And Humidity Sensor" library entry in the search results.
- Click the "DONE" button.
- Select the "FAVORITES" tab from the libraries side panel.
- Find the "Grove Temperature And Humidity Sensor" library entry in the favorites list.
- Hover the mouse pointer over the "Grove Temperature And Humidity Sensor" library entry.
You will see a downward pointing triangle icon appear to the right of the library name.
- Click the downward pointing triangle icon.
A context menu will open.
- Select "Download Library" from the menu from the context menu.
A download of the library will start.
- Wait for the download to finish.
- Click the upward pointing arrow button ("Import") to the right side of the "Library Manager" button.
- If you get a popup about importing your sketchbook, click the "Import" button.
A dialog will open that allows you to select a file on your computer to import to your Arduino Cloud account.
- Select the "ZIP" file that was downloaded to your computer by the previous step.
- Click the "Open" button.
- Wait for Arduino Web Editor to display the notification that the library was successfully imported.
- Click the "OK" button.
The libraries you import to your Arduino Cloud account are given higher priority by the Arduino sketch build system, so now when you compile your sketch you will find that the "Grove Temperature And Humidity Sensor" library was selected and the error will no longer occur.
Please let me know if you have any questions or problems while following those instructions.