Cube_Mini_Solution
Dependencies: mbed QEI MPU6050 BLE_API nRF51822 MCP4725 eMPL_MPU6050
LinearCharacteristics.h@18:3b1aa67e11ca, 2020-05-29 (annotated)
- Committer:
- BoulusAJ
- Date:
- Fri May 29 15:40:58 2020 +0000
- Revision:
- 18:3b1aa67e11ca
- Parent:
- 0:8e87cdf07037
Version May 29, 2020
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
BoulusAJ | 0:8e87cdf07037 | 1 | // Linear Characteristics for different purposes (map Voltage to acc etc.) |
BoulusAJ | 0:8e87cdf07037 | 2 | |
BoulusAJ | 0:8e87cdf07037 | 3 | |
BoulusAJ | 0:8e87cdf07037 | 4 | #ifndef LINEAR_CHARACTERISTICS_H_ |
BoulusAJ | 0:8e87cdf07037 | 5 | #define LINEAR_CHARACTERISTICS_H_ |
BoulusAJ | 0:8e87cdf07037 | 6 | |
BoulusAJ | 0:8e87cdf07037 | 7 | |
BoulusAJ | 0:8e87cdf07037 | 8 | class LinearCharacteristics{ |
BoulusAJ | 0:8e87cdf07037 | 9 | public: |
BoulusAJ | 0:8e87cdf07037 | 10 | LinearCharacteristics(){}; |
BoulusAJ | 0:8e87cdf07037 | 11 | LinearCharacteristics(float, float); |
BoulusAJ | 0:8e87cdf07037 | 12 | LinearCharacteristics(float, float, float, float); |
BoulusAJ | 0:8e87cdf07037 | 13 | LinearCharacteristics(float, float, float, float, float, float); |
BoulusAJ | 0:8e87cdf07037 | 14 | float evaluate(float); |
BoulusAJ | 0:8e87cdf07037 | 15 | void setup(float, float, float, float); |
BoulusAJ | 0:8e87cdf07037 | 16 | void setup(float, float, float, float, float, float); |
BoulusAJ | 0:8e87cdf07037 | 17 | float operator()(float x){ |
BoulusAJ | 0:8e87cdf07037 | 18 | return evaluate(x); |
BoulusAJ | 0:8e87cdf07037 | 19 | } |
BoulusAJ | 0:8e87cdf07037 | 20 | //... |
BoulusAJ | 0:8e87cdf07037 | 21 | virtual ~LinearCharacteristics(); |
BoulusAJ | 0:8e87cdf07037 | 22 | // here: the calculation function |
BoulusAJ | 0:8e87cdf07037 | 23 | |
BoulusAJ | 0:8e87cdf07037 | 24 | private: |
BoulusAJ | 0:8e87cdf07037 | 25 | // here: private functions and values... |
BoulusAJ | 0:8e87cdf07037 | 26 | float gain; |
BoulusAJ | 0:8e87cdf07037 | 27 | float offset; |
BoulusAJ | 0:8e87cdf07037 | 28 | float ulim; |
BoulusAJ | 0:8e87cdf07037 | 29 | float llim; |
BoulusAJ | 0:8e87cdf07037 | 30 | }; |
BoulusAJ | 0:8e87cdf07037 | 31 | |
BoulusAJ | 0:8e87cdf07037 | 32 | |
BoulusAJ | 0:8e87cdf07037 | 33 | #endif // LINEAR_CHARACTERISTICS_H_ |