Is it possible to have the Blynk API used in multiple or in a source (.cpp) file ? other than in .ino file.
I am using Blynk with particle core. When I place Blynk API say VIRTUAL_WRITE(XX) in a cpp file compiler throws me error. Unfortunately atom ide does not show detailed error it only says “firmware not made because of error”
When I place these APL calls in .ino file everything works fine.
I want to place them in different file just to have a clear and better structure for my project.
By the way, I am just loving Blynk. You guys are awesome.
Please wait for the reply from @vshymanskyy. He is the only one hardware Jedi here
Glad you like Blynk!
This is not a simple question as it may sound.
Our library provides “simple” headers which encapsulate some work that should have been done by the developer otherwise.
If you look in “BlynkSimple*.h” files you can notice there are some global objects defined here, and this is board-specific.
This was designed to work in Arduino IDE (which is not that good, I know).
To make it work, you would have to declare global objects “extern”, and include header files… I don’t think this is worth it.
Thanks for the reply.
I did it slightly different way and solved it.
I removed all the API calls of Blynk in .ino file and moved them to diffrent .h and .cpp file. This way including BlynkSimpleParticle.h only once and this seems to be working.
Thanks a lot.