mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
Добавил сенсор ccs811
This commit is contained in:
39
include/items/vSensorCcs811.h
Normal file
39
include/items/vSensorCcs811.h
Normal file
@@ -0,0 +1,39 @@
|
||||
#pragma once
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_CCS811.h"
|
||||
#include "Global.h"
|
||||
#include "GyverFilters.h"
|
||||
|
||||
class SensorCcs811;
|
||||
|
||||
typedef std::vector<SensorCcs811> MySensorCcs811Vector;
|
||||
|
||||
struct paramsCcs811 {
|
||||
String key;
|
||||
String addr;
|
||||
unsigned long interval;
|
||||
float c;
|
||||
};
|
||||
|
||||
class SensorCcs811 {
|
||||
public:
|
||||
SensorCcs811(const paramsCcs811& paramsCo2, const paramsCcs811& paramsPpm);
|
||||
~SensorCcs811();
|
||||
|
||||
Adafruit_CCS811* ccs811;
|
||||
|
||||
void loop();
|
||||
void read();
|
||||
|
||||
private:
|
||||
paramsCcs811 _paramsCo2;
|
||||
paramsCcs811 _paramsPpm;
|
||||
|
||||
unsigned long prevMillis;
|
||||
unsigned long difference;
|
||||
};
|
||||
|
||||
extern MySensorCcs811Vector* mySensorCcs811;
|
||||
|
||||
extern void ccs811Sensor();
|
||||
Reference in New Issue
Block a user