Files
IoTManager/include/Class/SensorConverting.h

33 lines
912 B
C
Raw Normal View History

2020-08-28 03:25:13 +03:00
#pragma once
#include <Arduino.h>
#include "Class/LineParsing.h"
#include "Global.h"
class SensorConverting : public LineParsing {
public:
SensorConverting() : LineParsing(){};
2020-08-28 03:58:54 +03:00
int mapping(int input) {
if (_map != "") {
_map.replace("map[", "");
_map.replace("]", "");
input = map(input,
selectFromMarkerToMarker(_map, ",", 0).toInt(),
selectFromMarkerToMarker(_map, ",", 1).toInt(),
selectFromMarkerToMarker(_map, ",", 2).toInt(),
selectFromMarkerToMarker(_map, ",", 3).toInt());
}
return input;
2020-08-28 03:25:13 +03:00
}
2020-08-28 03:58:54 +03:00
float correction(float input) {
_c.replace("c[", "");
_c.replace("]", "");
float coef = _c.toFloat();
input = input * coef;
return input;
}
2020-08-28 03:25:13 +03:00
};
2020-08-28 03:58:54 +03:00
//extern SensorConverting* mySensorConverting;