I tried to compile the code but I have a problem with my code which are :
‘class BlynkWifi’ has no member named ‘virtualWire’
‘class HardwareSerial’ has no member named ‘printin’
this is my code :
#define BLYNK_PRINT Serial//// comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
#include <SoftwareSerial.h>
#include <OneWire.h>
#include <DallasTemperature.h>
char auth[] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxx";
/* Wifi credentials */
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "xxxxxxxxxxxxxxxx";
char pass[] = "xxxxxxxxxxxxxxxxxxxxxx";
SimpleTimer Timer;
#define ONE_WIRE_BUS 2 // DS18B20 on Arduino pin2 corresponds to D4 on physical board “D4 pin on the nodemcu Module”
OneWire oneWire (ONE_WIRE_BUS);
DallasTemperature DS18B20 (&oneWire);
float temp;
float Fahrenheit=0;
void setup ()
{
Serial.begin (115200);
Blynk.begin (auth, ssid, pass);
DS18B20.begin ();
Timer.setInterval (1000L, getSendData);
}
void loop ()
{
Timer.run (); // Initiates SimpleTimer
Blynk.run ();
}
/**************************************************************************
*Send sensor data to Blynk
**************************************************************************/
void getSendData ()
{
//DS18B20.requestTemperature ();
float temp = DS18B20.getTempCByIndex (0); //Celcius
float Fahrenheit = DS18B20.toFahrenheit (temp); //Fahrenheit
//Serial.printin (temp);
Serial.printin (Fahrenheit);
Blynk.virtualWire (V3, temp); //virtual pin V3
Blynk.virtualWire (V4, Fahrenheit); //virtual pin V4
}