a test program for a distance sensor using a photo reflector. This program calibrate a model of relation between voltage and distance by the spline interpolation.

Dependencies:   mbed TRP105F_Spline

Files at this revision

API Documentation at this revision

Comitter:
aktk
Date:
Wed Oct 21 17:22:55 2020 +0000
Commit message:
test program verified

Changed in this revision

TRP105F_Spline.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 1fc7ec031057 TRP105F_Spline.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TRP105F_Spline.lib	Wed Oct 21 17:22:55 2020 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/aktk/code/TRP105F_Spline/#f6ec7796dafd
diff -r 000000000000 -r 1fc7ec031057 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Oct 21 17:22:55 2020 +0000
@@ -0,0 +1,19 @@
+#include "mbed.h"
+#include "TRP105F_Spline.h"
+
+DigitalOut myled(LED1);
+TRP105FS sensor(3,AsDEBUG);
+
+
+int main() {
+    
+    sensor.calibrateSensor();
+    sensor.saveSetting("sav.log");
+    
+    while(1) {
+        myled = 1;
+        wait(0.2);
+        myled = 0;
+        wait(0.2);
+    }
+}
diff -r 000000000000 -r 1fc7ec031057 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Oct 21 17:22:55 2020 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/6c34061e7c34
\ No newline at end of file