Dependencies:   FastPWM GMD_template_lib mbed

Files at this revision

API Documentation at this revision

Comitter:
inst
Date:
Sun Jul 10 13:17:14 2016 +0000
Parent:
5:9d1b1948a9b6
Child:
7:9671d3ae163e
Commit message:
???????????

Changed in this revision

GMD.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
--- a/GMD.lib	Sun Jul 03 03:15:31 2016 +0000
+++ b/GMD.lib	Sun Jul 10 13:17:14 2016 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/users/inst/code/GMD_template_lib/#3d70888e91c6
+https://developer.mbed.org/users/inst/code/GMD_template_lib/#6cf1d5d38ea3
--- a/main.cpp	Sun Jul 03 03:15:31 2016 +0000
+++ b/main.cpp	Sun Jul 10 13:17:14 2016 +0000
@@ -35,11 +35,13 @@
             case I2CSlave::WriteAddressed:
                 i2c.read(&buf, 1);
                 
+                /*
                 float p = (buf & 0x80) ? -1.0f : 1.0f;
                 p *= (buf & 0x7F);
                 p *= 1.0f / 0x7F;
+                */
                 
-                md.set(p);
+                md.set(static_cast<int8_t>(buf) / 127.0f);
                 break;
                 
             case I2CSlave::NoData: