BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

[SOLVED] How to countdown?


#21

can you give an example? with a small code. If you can help me with the code, please. Thanks.


#22

I’m not going to write your code for you, you’ll learn much more by doing it yourself. However, the process would be:

Write the value of CountdownRemain to a virtual pin each time it changes.

When you reboot your device it runs the void setup code, so in void setup you need to read the value of that virtual pin from the Blynk server (Research the Blynk.syncVirtual function for this). The value that you get back from the Blynk server will then need to be assigned to the CountdownRemain variable.

Do some work on this, and if you can’t get it working then post your code (correctly formatted with backticks and cpp) and explain what’s not working for you and we’ll point you in the right direction.

Pete.


#23

Thanks .I will try


#24

This is weird. Does not seem a post from the founder of Blynk.


#25

It’s often the best way.
Many people end-up here because they have limited IT skills (or at least limited experience of C++ programming) asking questions that aren’t really Blynk related. The Blynk side of things just adds an extra layer of complexity that often gets in the way. Stripping a problem down to the bare essentials, solving the problem, then adding the bells, whistles and Blynks is often the best approach.

Pete.


#26

It’s funny, as a maker, I think Blynk’s potential is in making possible projects that work simply with one line of code “Blynk.run();”


#27

If you want to use direct pin manipulation from the App then that’s fine.
For me, the real power of Blynk is unleashed when you use Virtual pins.

Pete.


#28

If only it were that simple :slight_smile: Blynk is a library, and like some other libraries, it sits in the background keeping in contact with the server and does stuff based on inputs given (direct pin manipulation, Blynk functions, etc). Blynk.run() is just one way of it keeping itself updated. And due to all that background stuff going on, one must accommodate their “normal” programming methods to mesh nicely with Blynk.

I have seen other libraries that do similar things… in fact it is thanks to Blynk that I now have a better understanding about some code for a fansnazy Stepper Controller Shield I set aside years ago due to just not understanding how it works… dusting it off soon for round 99+ :stuck_out_tongue:


#29

I am a Blynk believer after seeing “one-line-of-code” projects like Blynk for NodeMCU - Time Scheduled Switching, and many others.

You guys are doing a great job with Blynk and its amazing universe of widgets. Also, this community is a great evangelization platform.


#30

wow man, i introducing in the world of arduino and this help me too much, this is amazing for me, a lot of thanks


closed #31