not working version

This commit is contained in:
Dmitry Borisenko
2020-08-28 03:58:54 +03:00
parent 0c1a1940d2
commit eb6c06c8e9
2 changed files with 29 additions and 11 deletions

View File

@@ -9,12 +9,25 @@ class SensorConverting : public LineParsing {
public:
SensorConverting() : LineParsing(){};
void SensorConvertingInit() {
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;
}
float correction(float input) {
_c.replace("c[", "");
_c.replace("]", "");
float coef = _c.toFloat();
input = input * coef;
return input;
}
};
extern SensorConverting* mySensorConverting;
//extern SensorConverting* mySensorConverting;