V
V
vasuraden2019-12-10 19:59:16
Arduino
vasuraden, 2019-12-10 19:59:16

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

2 answer(s)
H
Homo Ludens, 2019-12-11
@HLudens

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 ...

E
evgeniy_lm, 2019-12-11
@evgeniy_lm

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 question

Ask a Question

731 491 924 answers to any question