Sumejja Porča Almir Husić

Dependencies:   mbed sMotor

Revision:
4:dae3f24939ab
Parent:
3:7f61e6ae0184
--- a/main.cpp	Sun Jun 08 23:25:27 2014 +0000
+++ b/main.cpp	Mon Jun 09 00:27:37 2014 +0000
@@ -15,7 +15,7 @@
 
 State state = Idle;
 int index = 0;
-int buffer_size = 300;
+int buffer_size = 36;
 int samples_num = 13;
 float distances[13] = {15.0, 20.0, 25.0, 30.0, 35.0, 40.0, 45.0, 50.0, 55.0, 60.0, 65.0, 70.0, 75.0};
 float voltages[13] = {0.78, 0.72, 0.63, 0.55, 0.47, 0.43, 0.39, 0.36, 0.34, 0.33, 0.32, 0.311, 0.31};
@@ -80,10 +80,8 @@
           break;
       }
       }
-     
-     ToString(value);
-     string distance = number;
-     pc.printf("%s\n", distance); 
+     int valueInt = int(value + 0.5);
+     pc.printf("%d\n", value); 
 }
 int main() {
     pc.attach(&CheckState);