Implement GPS module: add GPS_Init, GPS_Read, and GPS_Data functions; update includes and fix MQ7 references
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user