Test program with the RT black boxes

Dependencies:   mbed

Committer:
pmic
Date:
Wed May 15 13:58:10 2019 +0000
Revision:
43:a577f752dd7a
Parent:
22:cef093edb441
Add new instantiation option to surpress the printout for rt mbed

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rtlabor 0:15be70d21d7c 1 #include "LinearCharacteristics.h"
rtlabor 0:15be70d21d7c 2
rtlabor 0:15be70d21d7c 3 using namespace std;
rtlabor 0:15be70d21d7c 4
altb 22:cef093edb441 5 LinearCharacteristics::LinearCharacteristics(float gain,float offset){ // standard lin characteristics
altb 22:cef093edb441 6 this->gain = gain;
rtlabor 0:15be70d21d7c 7 this->offset = offset;
altb 22:cef093edb441 8 }
altb 22:cef093edb441 9
altb 22:cef093edb441 10 LinearCharacteristics::LinearCharacteristics(float xmin,float xmax, float ymin, float ymax){ // standard lin characteristics
altb 22:cef093edb441 11 this->gain = (ymax - ymin)/(xmax - xmin);
altb 22:cef093edb441 12 this->offset = xmax - ymax/this->gain;
altb 22:cef093edb441 13 }
altb 22:cef093edb441 14
altb 22:cef093edb441 15 LinearCharacteristics::~LinearCharacteristics() {}
rtlabor 0:15be70d21d7c 16
rtlabor 0:15be70d21d7c 17
altb 22:cef093edb441 18 float LinearCharacteristics::evaluate(float x)
altb 22:cef093edb441 19 {
altb 22:cef093edb441 20 return this->gain*(x - this->offset);
rtlabor 0:15be70d21d7c 21 }