A library that maps one range onto another range.
Dependents: Heiko Simran_Servo_2410 HYDRO-pH-BASIC NucleoBoard_1 ... more
Map.hpp
- Committer:
- Kerneels Bezuidenhout
- Date:
- 2016-09-28
- Revision:
- 1:dad975e2e150
- Parent:
- 0:f274b178a2d4
File content as of revision 1:dad975e2e150:
#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