sfbsg
Dependencies: mbed
LinearCharacteristics.cpp
- Committer:
- borlanic
- Date:
- 2018-04-03
- Revision:
- 0:8ab621116ccd
File content as of revision 0:8ab621116ccd:
#include "LinearCharacteristics.h" using namespace std; LinearCharacteristics::LinearCharacteristics(float k, float offset, float min, float max) // standard lin characteristics { this -> k = k; this -> offset = offset; this -> min = min; this -> max = max; // ... } LinearCharacteristics::~LinearCharacteristics(){} float LinearCharacteristics::trans(float input) { output = k*input + offset; if(output >= max) { output = max; } if(output <= min) { output = min; } return output; }