Cornelius Bezuidenhout / Map

Dependents:   Heiko Simran_Servo_2410 HYDRO-pH-BASIC NucleoBoard_1 ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Map.hpp Source File

Map.hpp

00001 #ifndef MAP_H
00002 #define MAP_H
00003 
00004 #include "mbed.h"
00005 
00006 /**
00007  *  A library that maps one range (inMin -> inMax) to another (outMin -> outMax)
00008  *
00009  * @author CA Bezuidenhout
00010  */
00011 class Map
00012 {
00013 public:
00014   /**
00015    * @param inMin : Minimum value of input range
00016    * @param inMax : Maximum value of input range
00017    * @param outMin : Minimum value of output range
00018    * @param outMax : Maximum value of output range
00019    */
00020   Map (float inMin, float inMax, float outMin, float outMax);
00021 
00022   /**
00023    * Map inVal onto the output range
00024    *
00025    * @param inVal : A value in the input range to be mapped onto the output range
00026    * @returns A value in the output range
00027    */
00028   float Calculate(float inVal);
00029 private:
00030   float _inMin,_inMax;
00031   float _outMin,_outMax;
00032 
00033 };
00034 #endif