A library that maps one range onto another range.
Map.hpp
- Committer:
- drorbalbul
- Date:
- 2019-12-27
- Revision:
- 2:ac294c579449
- Parent:
- 1:dad975e2e150
File content as of revision 2:ac294c579449:
#ifndef MAP_H #define MAP_H #include "mbed.h" /** * A library that maps one range (inMin -> inMax) to another (outMin -> outMax) * * @author CA Bezuidenhout */ class Map { public: /** * @param inMin : Minimum value of input range * @param inMax : Maximum value of input range * @param outMin : Minimum value of output range * @param outMax : Maximum value of output range */ Map(float inMin, float inMax, float outMin, float outMax); /** * Map inVal onto the output range * * @param inVal : A value in the input range to be mapped onto the output range * @returns A value in the output range */ float Calculate(float inVal); private: float _inMin,_inMax; float _outMin,_outMax; }; #endif