Phone screen

As “fun” as it is to take days if not months to create a mobile app, no one likes to wait. So, how can you get to something working that you can get up and running and focus on the next thing?

Enter Blynk.

Blynk is an app that creates apps. You can use it to monitor the air inside your house or even turn your lights on and off. Your imagination is your limitation.

The best part about it?

It took about two minutes.

Here’s the steps to get started:

  1. Install the library in Particle Dev

    Install the library in Particle Dev

  2. Include the library in your project.

    #include <blynk.h>
    
  3. Add the auth key

    char blynk_auth[] = "<your key here>";
    

    Note: Once you setup the Blynk app, it should give you your API key. Insert that above.

    Note: Also, for safety, make sure you don’t commit this!

  4. In your setup() initialize Blynk:

    Blynk.begin(blynk_auth);
    
  5. Write data where needed:

    Blynk.virtualWrite(<Vpin>, millis() / 1000);
    

    Whereis the virtual “pin” you’re writing to.

    Here are some examples of how I’m using it in my project:

    Blynk.virtualWrite(V0, String::format("%.2f", onboard_humidity / 100.0));
    Blynk.virtualWrite(V1, String::format("%.2f", onboard_temp / 100.0));
    Blynk.virtualWrite(V2, String::format("%.3f", thermo_temp));
    

    String::format generates a string from the floating point data from the sensors.

  6. Compile and load the firmware.

    Compile the firmware

  7. Now, in the Blynk app, and add your widget of choice:

    Adding the widget

    I added a labeled value in this case. I changed the label to match what I wanted it to display.

  8. Finally, connect the virtual pin to that

    Connecting a virtual "pin"

  9. “Start the application”

    Start the application

  10. Your app should start updating as long as your Particle is up and running. The frequency depends on your update interval. Thus, tweak that as necessary in your firmware.

In conclusion, this was a fast and convenient way to get data into a visual and mobile format. It saved me time and allowed me to focus on other things like writing this post!

Thanks for reading and be sure to signup for my free newsletter below so you’re never be in the dark.

😎👇