Hello Everyone
My first post on the community and second project with Blynk. I am trying to do a simple setup with wemos d1 mini clone + TMP36 temp sensor + Blynk. I am still learning so please be patient with me
Hardware is connected as such: TMP36 is connected to G pin, 3v3 pin and A0 pin physically on wemos
Blynk is setup for pin under analog A0
Here is the code that I am using
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
#include <OneWire.h>
#include <DallasTemperature.h>
SimpleTimer timer;
#define Pin 0// pin DATA ds18b20
char auth[] = "AUTH CODE HERE";
OneWire ourWire(Pin);
DallasTemperature sensors(&ourWire);
char ssid[] = "WIFI NAME HERE";
char pass[] = "WIFI PASSWORD HERE";
void setup()
{
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
sensors.begin();
delay(5000);
timer.setInterval(2000L, leeTEMP);
}
void leeTEMP()
{
sensors.requestTemperatures();
Blynk.virtualWrite(0, sensors.getTempCByIndex(0));
}
void loop()
{
Blynk.run();
timer.run();
}