GY-63_MS5611/libraries/FastMap/examples/fastMapDemo3/fastMapDemo3.ino
2020-11-27 11:16:22 +01:00

50 lines
933 B
C++

// FILE: fastMapDemo3.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.1.1
// PURPOSE: demo of FastMap class ==> a faster map function
// DATE: 2014-11-02
// URL: https://github.com/RobTillaart/FastMap
// http://forum.arduino.cc/index.php?topic=276194
#include "FastMap.h"
FastMap CtoF;
void setup()
{
Serial.begin(115200);
Serial.print("Start fastMapDemo3\nlib version: ");
Serial.println(FASTMAP_LIB_VERSION);
Serial.println();
CtoF.init(0, 100, 32, 212);
float f = CtoF.map(163);
Serial.print(f);
Serial.print(char(176));
Serial.println('F');
float c = CtoF.back(f);
Serial.print(c);
Serial.print(char(176));
Serial.println('C');
f = CtoF.upperConstrainedMap(163);
Serial.print(f);
Serial.print(char(176));
Serial.println('F');
f = CtoF.lowerConstrainedMap(163);
Serial.print(f);
Serial.print(char(176));
Serial.println('C');
}
void loop()
{
}
//
// END OF FILE
//