This lib is supposed to be used as a sensor's calibration or control program. This makes Cubic Spline Model from some sample plots(sets of (value, voltage)), and then discretize the model (dividing the range of voltage into some steps) in order to use the calibrated model data without getting the INVERSE function.

Revision:
11:d60fb729eacf
Parent:
10:b50e4bb40571
Child:
12:db5110d9d494
--- a/TRP105F_Spline.h	Mon Jun 06 15:41:44 2016 +0000
+++ b/TRP105F_Spline.h	Mon Jun 06 19:49:20 2016 +0000
@@ -21,18 +21,16 @@
  *      Distance data range : [2:20] by 1 -> [0:1024] by 1.
  *  ver.2.1 2016/02.12 - 2016/02/16
  *      Distance data range : [0:1024] -> [0:255].
- *  ver.3.0 2016/05.23 - 
+ *  ver.3.0 2016/05.23 -
  */
-#ifndef TRP105F_Spline_H
-#define TRP105F_Spline_H
+ 
+#ifndef TRP105F_SPLINE_H
+#define TRP105F_SPLINE_H
 
-#define DEFALT_AI_PIN p16
 
 #include "mbed.h"
-
+#include "CODE_SELECTIVE.h"
 
-//  For SPI
-//int DAread(int channel);
 
 //  Set of voltage-distance
 typedef struct {
@@ -75,7 +73,9 @@
     void    loadSetting();
     void    loadSetting(const char *filename);
     void    printOutData(const char *filename);
+#ifdef HAS_COM_TO_CONSOLE
     void    printThresholds();
+#endif
 
 private:
     //
@@ -104,7 +104,9 @@
     //
     //  For calibration
     //
+#ifdef HAS_COM_TO_CONSOLE
     void    _sampleData();
+#endif
     void    _setSample(unsigned short,unsigned short);
     void    _setSamples(VDset* arg_set, unsigned int arg_num);
     unsigned short _getSplineYof(double arg_x);