sfbsg

Dependencies:   mbed

Committer:
borlanic
Date:
Tue Apr 03 15:17:11 2018 +0000
Revision:
0:8ab621116ccd
fg

Who changed what in which revision?

UserRevisionLine numberNew contents of line
borlanic 0:8ab621116ccd 1 #ifndef LINEAR_CHARACTERISTICS_H_
borlanic 0:8ab621116ccd 2 #define LINEAR_CHARACTERISTICS_H_
borlanic 0:8ab621116ccd 3
borlanic 0:8ab621116ccd 4 #include <cstdlib>
borlanic 0:8ab621116ccd 5 #include <mbed.h>
borlanic 0:8ab621116ccd 6
borlanic 0:8ab621116ccd 7 // Linear Characteristics for different purposes (map Voltage to acc etc.)
borlanic 0:8ab621116ccd 8 class LinearCharacteristics
borlanic 0:8ab621116ccd 9 {
borlanic 0:8ab621116ccd 10 public:
borlanic 0:8ab621116ccd 11
borlanic 0:8ab621116ccd 12 LinearCharacteristics(float k, float offset, float min, float max);
borlanic 0:8ab621116ccd 13 float trans(float input);
borlanic 0:8ab621116ccd 14
borlanic 0:8ab621116ccd 15 // float operator()(float input) {
borlanic 0:8ab621116ccd 16 // return trans(input);
borlanic 0:8ab621116ccd 17 // }
borlanic 0:8ab621116ccd 18 //...
borlanic 0:8ab621116ccd 19 //...
borlanic 0:8ab621116ccd 20 virtual ~LinearCharacteristics();
borlanic 0:8ab621116ccd 21 // here: the calculation function
borlanic 0:8ab621116ccd 22
borlanic 0:8ab621116ccd 23
borlanic 0:8ab621116ccd 24 private:
borlanic 0:8ab621116ccd 25 // here: private functions and values...
borlanic 0:8ab621116ccd 26 float k;
borlanic 0:8ab621116ccd 27 float offset;
borlanic 0:8ab621116ccd 28 float output;
borlanic 0:8ab621116ccd 29 float min;
borlanic 0:8ab621116ccd 30 float max;
borlanic 0:8ab621116ccd 31
borlanic 0:8ab621116ccd 32 };
borlanic 0:8ab621116ccd 33
borlanic 0:8ab621116ccd 34 #endif