I know that there is many posts about this or similar problems, as I have read through a few of them to see if I can solve this by myself.
All I know from other posts that there is a . in the wrong place??
home/rob/sketchbook/CBsics_DHT_LCD/CBsics_DHT_LCD.ino: In function 'void loop()':
CBsics_DHT_LCD:16:16: error: expected primary-expression before '.' token
int chk = DHT.read11(DHT11_PIN);
^
CBsics_DHT_LCD:19:16: error: expected primary-expression before '.' token
lcd.print(DHT.temperature);
^
CBsics_DHT_LCD:24:16: error: expected primary-expression before '.' token
lcd.print(DHT.humidity);
^
Multiple libraries were found for "DHT.h"
Used: /home/rob/sketchbook/libraries/DHT
Not used: /home/rob/sketchbook/libraries/DHT_sensor_library
Multiple libraries were found for "LiquidCrystal.h"
Used: /opt/arduino-1.8.8/libraries/LiquidCrystal
Not used: /home/rob/sketchbook/libraries/Newliquidcrystal_1.3.5
Using library DHT in folder: /home/rob/sketchbook/libraries/DHT (legacy)
Using library LiquidCrystal at version 1.0.7 in folder: /opt/arduino-1.8.8/libraries/LiquidCrystal
exit status 1
expected primary-expression before '.' token
avalon66:
The DHT library I am using is just the one which is the one in the sketch/code: <DHT.h>
There a several libraries that use the name "DHT.h". EXACTLY which one are you using? If you downloaded and installed in manually, provide a clickable link. If you installed it with the Arduino Library Manager, go there and check which one it is. Tell us precisely.
I'm not sure which built-in examples you mean. I have tried the DHT sensor library, still same error, Adafruit unified sensor, still the same error.
Almost every library comes with simple, built-in example that show how to use it. Have you tried those?
gfvalvo:
There a several libraries that use the name "DHT.h". EXACTLY which one are you using? If you downloaded and installed in manually, provide a clickable link. If you installed it with the Arduino Library Manager, go there and check which one it is. Tell us precisely.
Almost every library comes with simple, built-in example that show how to use it. Have you tried those?
No I have not tried those, and I cannot see I have actually seen any built- in examples.
The DHT.h file is in a folder called DHT, and I downloaded it from github:
DHT Temperature & Humidity Sensor library for Arduino.
Features:
Support for DHT11 and DHT22/AM2302/RHT03
Auto detect sensor model
Very low memory footprint
Very small code
Written by Mark Ruys, mark@paracas.nl.
As I said initially, I got the sketch from circuit basics site and there was no library file include to actually download. Because it was typed as <dht.h>, I then assumed that it should be <DHT.h>. I knew I alread a DHT library, so that is what I used.
I've found another DHT library from Rob Tillart
FILE: dht.h
// AUTHOR: Rob Tillaart
// VERSION: 0.1.14
// PURPOSE: DHT Temperature & Humidity Sensor library for Arduino
// URL: Arduino Playground - HomePage
//
It looks like the tutorial you were following was using a different DHT library than the one you have. Look at the example sketch that comes with your library - the functions it provides are completely different. Start with that & then add in your LCD stuff.
Error is in the line naming the object.
So change DHT dht to dht DHT.
And leave DHT.read without any numbers attached to the word read. There is no function read11 in that library.
Or better look the examples in library as others advised.
The coding starts from just under this: Display Humidity and Temperature on an LCD
and is the 1st block of code which you can scroll up and down a little.