|  | SAE Teensy ECU
    IIT SAE Microcontroller programming | 
Various utility functions. More...
Go to the source code of this file.
| Classes | |
| class | AvgVar< T > | 
| Variable that automaticaly averages itself out when it is set to a value.  More... | |
| class | AvgVarRef< T > | 
| Variable that automaticaly averages itself out when it is called, that is, it only updates it's average when the variable is used.  More... | |
| Macros | |
| #define | Euler exp(1.0) | 
| Euler's constant. | |
| #define | clamp(v, m, x) min(max(v, m), x) | 
| Clamp function. | |
| Functions | |
| double | EMAvg (double lastVal, double newVal, int memCount) | 
| Exponential moving average. | |
| template<class T , class A , class B , class C , class D > | |
| T | cMap (T x, A inMin, B inMax, C outMin, D outMax) | 
| Map a value from one range to another while clamping the value to boundaries. | |
Various utility functions.
Definition in file Util.h.
| T cMap | ( | T | x, | 
| A | inMin, | ||
| B | inMax, | ||
| C | outMin, | ||
| D | outMax | ||
| ) | 
Map a value from one range to another while clamping the value to boundaries.
| x | The value to be mapped | 
| inMin | The minimum input value | 
| inMax | The maximum input value | 
| outMin | The minimum output value | 
| outMax | The maximum output value | 
| double EMAvg | ( | double | lastVal, | 
| double | newVal, | ||
| int | memCount | ||
| ) |