How to add blynk specific code in arduino code to control the arduino using blynk app

My advice first advice would be to throw away the Uno and ESP-01 and use a NodeMCU or Wemos D1 Mini instead.

Then, I would be to search this forum for other projects that use this sensor, with whatever board you choose to use, and use that code as a starting point.

https://community.blynk.cc/search?q=MQ2

If you want to stick with the original plan the start by reading this:
http://help.blynk.cc/getting-started-library-auth-token-code-examples/blynk-basics/keep-your-void-loop-clean

and look at the Sketch Builder examples here:

Pete.

1 Like