#define BLYNK_PRINT DebugSerial
// You could use a spare Hardware Serial on boards that have it (like Mega)
SoftwareSerial DebugSerial(2, 3); // RX, TX
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth = "lENO2Pj-R5EbUCf-eqD1bNiqhmS1UmCI";
// Debug console
// Blynk will work through Serial
// Do not read or write this serial manually in your sketch
val = analogRead(A0);
float mv = ( val/1024.0)*5000;
float cel = mv/10;
float farh = (cel*9)/5 + 32;
Serial.print("TEMPRATURE = ");
My serial connection:
Connecting device at COM6 to blynk-cloud.com:80…
OpenC0C("\.\COM6", baud=115600, data=8, parity=no, stop=1) - OK
Connect(“blynk-cloud.com”, “80”) - OK
DSR is OFF
Arduino Uno connected to my pc
pc connected to same network of mobile
Problem:Reading in Blynk app get updated only once(If the reading was 95 at starting it keeps on the same its not updating over time.)
@Ben_Asir please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
Copy and paste these characters if you can’t find the correct character on your keyboard.
Your code breaks the golden rule of Blynk. You have virtual writes in your void loop, which will flood the server. Read this:
but i need to get data from sensor all time
In that case, Blynk is the wrong platform for you.
But can we use a local server insted of blynk server
You still can’t have the virtual writes in the void loop, regardless f whether you use local or cloud server.
Did you bother to read the document I linked to?
i read it . My program is working fine now( though i have plenty of content in loop)
my problem was
i used USB connected arduino uno @ band width 9600 (which is too low)
When i changed it to 1000000 the communication was fine in the usb and the blynk app updates it every second.
Morover i use local server which is programed to accept 50 request per second
sir how to change this topic to solved topic
I guess it depends on how reliable you want your system to be. Those people who have used Blynk for many years will recognise how foolish your approach is.
I’m afraid that this makes no sense to me.
The problem with this approach is that you have no control over the timing of your void loop. The frequency is simply a function of the clock speed of the CPU and how long it takes for the void loop to execute.