m3pi publish

Fork of m3pi by Chris Styles

Files at this revision

API Documentation at this revision

Comitter:
Maximousse
Date:
Thu May 03 12:57:40 2018 +0000
Parent:
8:4b7d6ea9b35b
Commit message:
commit m3pi;

Changed in this revision

m3pi.cpp Show annotated file Show diff for this revision Revisions of this file
m3pi.h Show annotated file Show diff for this revision Revisions of this file
--- a/m3pi.cpp	Thu May 12 13:26:37 2011 +0000
+++ b/m3pi.cpp	Thu May 03 12:57:40 2018 +0000
@@ -112,6 +112,16 @@
     return(fpos);
 }
 
+
+void m3pi::calibrated_sensors(unsigned short ltab[5]) {
+    unsigned i;
+    _ser.putc(SEND_CALIB_SENSOR_VALUES);
+    for(i=0;i<5;i++){
+        ltab[i] = (unsigned short) _ser.getc();
+        ltab[i] += _ser.getc() << 8;
+    }
+}
+
 char m3pi::sensor_auto_calibrate() {
     _ser.putc(AUTO_CALIBRATE);
     return(_ser.getc());
--- a/m3pi.h	Thu May 12 13:26:37 2011 +0000
+++ b/m3pi.h	Thu May 03 12:57:40 2018 +0000
@@ -30,6 +30,7 @@
 #include "rpc.h"
 #endif
 
+#define SEND_CALIB_SENSOR_VALUES 0x87
 #define SEND_SIGNATURE 0x81
 #define SEND_RAW_SENSOR_VALUES 0x86
 #define SEND_TRIMPOT 0xB0
@@ -169,7 +170,7 @@
      *
      */
     char sensor_auto_calibrate (void);
-
+    void m3pi::calibrated_sensors(unsigned short ltab[5]);
     /** Set calibration manually to the current settings.
      *
      */