Refactor GPS and MQ7 sensor implementations: update function signatures, improve initialization, and streamline data reading logic
This commit is contained in:
@@ -1,23 +1,15 @@
|
||||
#include <Arduino.h>
|
||||
|
||||
#define MQ7_PIN 34
|
||||
#define VCC 5.0
|
||||
#define ADC_RES 1023.0
|
||||
#define RL 10000.0 // 10kΩ
|
||||
#define RO 10000.0 // Resistencia del aire limpio
|
||||
#define RELAY_CONTROL_PIN 2
|
||||
#define MAX_SAMPLES 90
|
||||
|
||||
enum MQ7State_t
|
||||
{
|
||||
HEATING, SAMPLING
|
||||
};
|
||||
#define MQ7_A0 34
|
||||
#define MQ7_D0 35
|
||||
#define R0 20000
|
||||
#define RL 10000
|
||||
|
||||
struct MQ7Data_t
|
||||
{
|
||||
float co;
|
||||
bool threshold;
|
||||
};
|
||||
|
||||
void MQ7_Init();
|
||||
bool MQ7_Update();
|
||||
MQ7Data_t MQ7_Read();
|
||||
Reference in New Issue
Block a user