Answer the question
In order to leave comments, you need to log in
How to combine two sketches into one so that two sensors work at the same time?
There are two sensors BMP-280 and MQ-2 and there are two sketches for them working separately, but you need to work together in one sketch with connection to NodeMCU
Answer the question
In order to leave comments, you need to log in
understand the sketch code, transfer everything related to the MQ-2 sensor to the BMP-280 code.
those. from setup to setup , from loop to loop, and so on.
actually, as far as I remember, MQ-2 works simply through an analog input, there will be three lines of code in total ...
What's the problem? You add the missing code from one sketch to another. The main thing to remember is that the BMP-280 uses hardware I2C (pins A4, A5) so that A0-A3 are available for MQ-2
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question