1
0

Refactor GPS and MQ7 sensor implementations: update function signatures, improve initialization, and streamline data reading logic

This commit is contained in:
Jose
2025-05-07 04:14:39 +02:00
parent b2c7b7677b
commit 383202709e
7 changed files with 54 additions and 110 deletions

View File

@@ -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();