Expected primary-expression before '.' token

Good Afternoon All

I am learning programming with Arduino and I need help with getting my little OLED 128x32 to work. I have spent all day watching video’s reading guidance and am getting nowhere fast.

I have hacked a few example pages to try get a working program but with no success. Its one error after another …

The end product is going to be a little monitor that uses a relays to turn-on fan/heater element when temp is below 30C and humidity is above 40%

Here my code so far:-

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include “DHT.h”

#define DHTPIN 2 // Digital pin connected to the DHT sensor
#define DHTTYPE DHT11 // DHT 11
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 32 // OLED display height, in pixels
DHT dht(DHTPIN, DHTTYPE);

// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
#define OLED_RESET 4 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

void setup()
{
Serial.begin(9600);
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) // Address 0x3C for 128x32
{
Serial.println(F(“SSD1306 allocation failed”));
for (;;);
}
delay(600);
display.clearDisplay();
//OLED Display
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(7, 7);
// Display static text
display.println(“ARDUINO”);
display.println(“SMART”);
display.println(“WATCH”);
display.display();
delay(600);
display.begin(128, 32);
}

void loop()
{
int chk = DHT.read11(DHT11_PIN);
display.setCursor(7, 7);
display.println("Temp: ");
display.println(DHT.temperature);
display.println((char)223);
display.println(“C”);
display.setCursor(7, 7);
display.println(“Humidity: “);
display.println(DHT.humidity);
display.println(”%”);
delay(1000);
}

I can get the temp and humidity fine :-

7:44:55.031 → Humidity: 55.00% Temperature: 23.70°C 74.66°F Heat index: 23.56°C 74.41°F
17:44:58.686 → Humidity: 55.00% Temperature: 23.70°C 74.66°F Heat index: 23.56°C 74.41°F
17:45:02.321 → Humidity: 55.00% Temperature: 23.70°C 74.66°F Heat index: 23.56°C 74.41°F
17:45:05.988 → Humidity: 55.00% Temperature: 23.70°C 74.66°F Heat index: 23.56°C 74.41°F

Please help … anyone

DHT dht(DHTPIN, DHTTYPE);

You have an object named dht

display.println(DHT.humidity);

But you seem to be trying to use an object named DHT

Spot the difference

Ah OK thanks let me try and compile again ..