Sentinel
Loading...
Searching...
No Matches
mq2.h
Go to the documentation of this file.
1
9
10
#ifndef SENSOR_MQ2
11
#define SENSOR_MQ2
12
13
#include "
config.h
"
14
#include <Arduino.h>
15
#include <MQUnifiedsensor.h>
16
23
24
25
class
MQ2Sensor
26
{
27
public
:
28
MQ2Sensor
(uint8_t pin,
const
char
*board =
"ESP-32"
,
float
voltageResolution = 3.3,
29
uint8_t adcBitResolution = 12,
const
char
*type =
"MQ-2"
);
30
void
update
();
31
int
getValue
();
32
void
begin
();
33
void
calibrate
();
34
35
private
:
36
MQUnifiedsensor mq2;
37
};
38
39
#endif
MQ2Sensor::begin
void begin()
Initializes the MQ2 sensor.
Definition
mq2.cpp:37
MQ2Sensor::update
void update()
Updates the MQ2 sensor.
Definition
mq2.cpp:73
MQ2Sensor::calibrate
void calibrate()
Calibrates the MQ2 sensor.
Definition
mq2.cpp:52
MQ2Sensor::getValue
int getValue()
Gets the value from the MQ2 sensor.
Definition
mq2.cpp:85
MQ2Sensor::MQ2Sensor
MQ2Sensor(uint8_t pin, const char *board="ESP-32", float voltageResolution=3.3, uint8_t adcBitResolution=12, const char *type="MQ-2")
Construct a new MQ2Sensor object.
Definition
mq2.cpp:24
config.h
Configuration Header File.
include
sensors
mq2.h
Generated by
1.13.2