Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of RT2_P3_students_G4 by
Diff: LinearCharacteristics.cpp
- Revision:
- 5:72982ede2ff6
- Parent:
- 4:2cc56521aa16
- Child:
- 7:01a7363583b2
--- a/LinearCharacteristics.cpp Tue Apr 10 11:44:36 2018 +0000
+++ b/LinearCharacteristics.cpp Tue Apr 17 09:06:47 2018 +0000
@@ -2,9 +2,15 @@
using namespace std;
-LinearCharacteristics::LinearCharacteristics(){ // standard lin characteristics
-
+LinearCharacteristics::LinearCharacteristics(float gain,float offset){ // standard lin characteristics
+ this->gain = gain;
+ this->offset = offset;
}
LinearCharacteristics::~LinearCharacteristics() {}
+
+float LinearCharacteristics::evaluate(float x)
+{
+return this->gain*(x - this->offset);
+ }
