#include <dht.h>
dht DHT;
int temp,humi;
#define DHT11_PIN A0
String str;
void setup(){
Serial.begin(115200);
Serial1.begin(115200);
Serial.print(char(169)); // Copyright Symbol
Serial.println(" Myengineeringstuffs.com");
delay(2000);
}
void loop()
{
DHT.read11(DHT11_PIN);
humi=DHT.humidity;
temp=DHT.temperature;
Serial.print("H: ");
Serial.print(humi);
Serial.print("% ");
Serial.print(" T: ");
Serial.print(temp);
Serial.print(char(176));
Serial.println("C");
str =String('H')+String(humi)+String('T')+String(temp);
Serial1.print(str);
delay(5000);
}
And this is my ESP8266-12 code (which i dont know why its not!):
void setup() {
Serial.begin(115200);
while (!Serial) {
Serial.write("pls work!"); // wait for serial port to connect. Needed for native USB port only
}
}
void loop() {
if (Serial.available()) {
Serial.write(Serial.read());
}
}
The arduino should be sending the temp and humidity data through Serial1 using the String str which i think it is, but the esp module is not printing it on its own serial. i have each device connected to a different port just as this video is telling me to do: [youtube]https://www.youtube.com/watch?v=-6Nb5kL43GY&list=LLbZB7cnQl5E4S6bYraYptww&index=3&t=485s[/youtube]
but i am not getting the same result as he is, i only get a blank screen for my esp serial monitor!
Any help is very much appreciated!!