2.007 PulleyInterface mbed code. Biomimetics robotics lab. Sangbae Kim. Ben Katz. For use with PulleyInterface.mlapp

Dependencies:   mbed

Revision:
9:d8d2778bfbfd
Parent:
8:6ae3c3cd7f55
Child:
10:ae139f40acc0
--- a/main.cpp	Tue Feb 14 20:36:07 2017 +0000
+++ b/main.cpp	Tue Feb 14 20:37:53 2017 +0000
@@ -99,6 +99,9 @@
     
     while(1) {
     
+        currentSensorOffset = 0; i = 0;
+        for(i=1;i<201;i++){ currentSensorOffset += currentSense.read(); } //TODO: watch out this could take some time, but this should make things better!
+        currentSensorOffset = currentSensorOffset*VREF/300;
     
         while(1) {
             
@@ -128,10 +131,6 @@
     
         while(1) {
             
-           // currentSensorOffset = 0; i = 0; TODO: this is not working
-//            for(i=1;i<201;i++){ currentSensorOffset += currentSense.read(); } //TODO: watch out this could take some time, but this should make things better!
-//            currentSensorOffset = currentSensorOffset*VREF/300;
-            
             green = false;
             wait(updatePeriod);
             start = end;