I tried this code to show the temp at blynk but I does not work, I am using serial USB not ESP8266
Where is the problem?
Code
#define BLYNK_PRINT DebugSerial
// You could use a spare Hardware Serial on boards that have it (like Mega)
#include <SoftwareSerial.h>
SoftwareSerial DebugSerial(2, 3); // RX, TX
#include <BlynkSimpleStream.h>
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <SimpleTimer.h>
#include <SPI.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "e5047224d2a043ac831f1cb98fb87361";
const int sensor=0;//variable to anloge A0 parameter
float tempC; //variable to store temperature in degree Celsius
float vout; //variable to convert analoge read from scale of 0-1023 to scale of 0-5
SimpleTimer timer;
void setup()
{
pinMode(sensor,INPUT);
timer.setInterval( 1000L , sendUptime);
// Debug console
DebugSerial.begin(9600);
// Blynk will work through Serial
// Do not read or write this serial manually in your sketch
Serial.begin(9600);
Blynk.begin(Serial, auth);
}
void sendUptime()
{
Blynk.virtualWrite(10, tempC);// sends tempC to Blynk server
}
void loop()
{
Blynk.run();
timer.run(); // Initiates SimpleTimer
vout=analogRead(sensor);
vout=(vout*500)/1023;//convert analoge read from scale of 0-1023 to scale of 0-5
tempC = vout - 2.5; //correction
Serial.print("Temprature = ");
Serial.print(tempC);// to view the temp value on the serial monitor
Serial.print(" C");
Serial.println();
}