Merge branch 'main' into feature/bmp280
This commit is contained in:
8
hardware/include/BMP280.hpp
Normal file
8
hardware/include/BMP280.hpp
Normal file
@@ -0,0 +1,8 @@
|
||||
#include <Wire.h>
|
||||
#include <BMP280_DEV.h>
|
||||
|
||||
#define I2C_BMP280_ADDRESS 0x76
|
||||
|
||||
void BMP280_Init();
|
||||
uint8_t BMP280_DataReady();
|
||||
void BMP280_Read();
|
||||
17
hardware/lib/BMP280.cpp
Normal file
17
hardware/lib/BMP280.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#include "BMP280.h"
|
||||
|
||||
|
||||
void BMP280_Init()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
uint8_t BMP280_DataReady()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void BMP280_Read(float &temperature, float &humidity, float &pressure, float &altitude)
|
||||
{
|
||||
|
||||
}
|
||||
30
hardware/lib/MQ7.cpp
Normal file
30
hardware/lib/MQ7.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#include "MQ7.h"
|
||||
|
||||
void MQ7_Init()
|
||||
{
|
||||
pinMode(digitalMQ7, INPUT);
|
||||
pinMode(analogMQ7, INPUT);
|
||||
}
|
||||
|
||||
void MQ7_Read(float &sensorVolt, float &RSAir, float &R0, float &sensorValue)
|
||||
{
|
||||
analogWrite(analogMQ7, 1023);
|
||||
delay(60000);
|
||||
analogWrite(analogMQ7, (1023/5)*1.4 );
|
||||
|
||||
for(int i = 0; i<100; i++)
|
||||
{
|
||||
sensorValue = sensorValue + analogRead(analogMQ7);
|
||||
delay(90000);
|
||||
}
|
||||
|
||||
sensorValue = sensorValue/100.0;
|
||||
sensorVolt = sensorValue/1024*5.0;
|
||||
RSAir = (5.0-sensorVolt)/sensorVolt;
|
||||
R0 = RSAir/(26+(1/3));
|
||||
|
||||
Serial.print("R0 = ");
|
||||
Serial.println(R0);
|
||||
|
||||
delay(1000);
|
||||
}
|
||||
Reference in New Issue
Block a user