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
Revision 0:1fc7ec031057, committed 2020-10-21
- Comitter:
- aktk
- Date:
- Wed Oct 21 17:22:55 2020 +0000
- Commit message:
- test program verified
Changed in this revision
--- /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
--- /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);
+ }
+}
--- /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