Hi all. I am not very familiar with Arduino. Doing this for the uni project. Please help :")
Im doing a humidity + temp sensor with Bluetooth monitoring.
Here is my error:
In function 'void loop()':
sketch_apr21a:27:21: error: expected primary-expression before '.' token
int readData = DHT.read11(dataPin);
^
sketch_apr21a:29:12: error: expected primary-expression before '.' token
hum = DHT.humidity;
^
sketch_apr21a:30:13: error: expected primary-expression before '.' token
temp = DHT.temperature;
^
exit status 1
expected primary-expression before '.' token
My code:
#include <SoftwareSerial.h>
SoftwareSerial bt(8, 9); // RX, TX
#include "DHT.h"
#define dataPin 3
// Pin for the DHT sensor
#define DHTPIN 3
#define DHTTYPE DHT11
DHT dht (DHTPIN, DHTTYPE);
int temp;
int hum;
void setup() {
Serial.begin(9600);
bt.begin(9600);
Serial.println("Ready");
}
void loop(){
int readData = DHT.read11(dataPin);
hum = DHT.humidity;
temp = DHT.temperature;
bt.print(temp);
bt.print(";");
bt.print(hum);
bt.println(";");
delay(10000);
}