Lm35 sensor with arduino

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(); 
}

Really two nights?

In order to get help you should first decide whether you want to be open minded or not when posting in open source community forum.

@prano Um… did you accidently reply to the wrong topic? :wink:

@sskaa You need to provide more info then “does not work”… in which way did something not work, what have you tried to do to resolve the “not working” issue, etc. You mention using the USB link… is that working fine and your app is showing the device as connected?

I also edited your post to properly format the code… please look back at that to see how it is done:

Hmm… i don’t think you should output things to serial if you have Blynk using it already.

But, as Gunner said, there’s not enough detail to pinpoint the problem.

Good catch @Gspin I noted the DebugSerial but not the Serial.print… yes, that will totally ruin a USB-link connection.