GithubHelp home page GithubHelp logo

Comments (3)

Chris722 avatar Chris722 commented on June 25, 2024 1

Hi tbmart16,

This code works for me:

#include <MQ131.h>

MQ131Class highSensor = new MQ131Class(8000); # Load resistance RL of 8kOhms (8000 Ohms)
MQ131Class lowSensor = new MQ131Class(1000000); # Looad resistance RL of 1MOhms (1000000 Ohms)

void setup() {
Serial.begin(115200);

highSensor.begin(2,A0, HIGH_CONCENTRATION, 8000, (Stream *)&Serial);
[...]

from arduino-mq131-driver.

ostaquet avatar ostaquet commented on June 25, 2024

As you can see in the header file, the sensor is created through the instance of MQ131Class.

In order to have multiple instance of the driver, you just have to instantiate the class more than once.

Per example:

MQ131Class lowSensor = new MQ131Class();
MQ131Class highSensor = new MQ131Class();

lowSensor->begin(...);
highSensor->begin(...);
[...]

from arduino-mq131-driver.

tbmart16 avatar tbmart16 commented on June 25, 2024

Hi ostaquet,

I have a similar goal of using both a high concentration and low concentration sensor in my program. I see your response above and I tried to implement it into my Arduino code, but I get an error. Should I put your example above before the void setup() or inside of the void setup()?

from arduino-mq131-driver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.