1
0

Implement GPS module: add GPS_Init, GPS_Read, and GPS_Data functions; update includes and fix MQ7 references

This commit is contained in:
PinkyFlowy
2025-04-12 13:13:04 +02:00
parent 63fda936bb
commit 42ad7f7ac9
8 changed files with 79 additions and 50 deletions

View File

@@ -1,20 +1,20 @@
#include "MQ7.h"
#include "MQ7.hpp"
void MQ7_Init()
{
pinMode(digitalMQ7, INPUT);
pinMode(analogMQ7, INPUT);
pinMode(DIGITAL_MQ7, INPUT);
pinMode(ANALOG_MQ7, INPUT);
}
void MQ7_Read(float &sensorVolt, float &RSAir, float &R0, float &sensorValue)
{
analogWrite(analogMQ7, 1023);
analogWrite(ANALOG_MQ7, 1023);
delay(60000);
analogWrite(analogMQ7, (1023/5)*1.4 );
analogWrite(ANALOG_MQ7, (1023/5)*1.4 );
for(int i = 0; i<100; i++)
{
sensorValue = sensorValue + analogRead(analogMQ7);
sensorValue = sensorValue + analogRead(ANALOG_MQ7);
delay(90000);
}