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.
Map.cpp
- Committer:
- Kerneels Bezuidenhout
- Date:
- 2016-09-28
- Revision:
- 1:dad975e2e150
- Parent:
- 0:f274b178a2d4
- Child:
- 2:895b3a247932
File content as of revision 1:dad975e2e150:
#include "Map.hpp"
Map::Map(float inMin, float inMax, float outMin, float outMax)
{
_inMin = inMin;
_inMax = inMax;
_outMin = outMin;
_outMax = outMax;
}
float Map::Calculate(float inVal)
{
return ( (inVal - _inMin)*(_outMax - _outMin)/(_inMax - _inMin) + _outMin );
}