its a library for testing the car

Dependencies:   FRDM-TFC

Revision:
1:3396030f7c8a
Parent:
0:b9d22501052e
--- a/testing.cpp	Tue Nov 29 15:05:18 2016 +0000
+++ b/testing.cpp	Sun Dec 04 15:50:53 2016 +0000
@@ -1,1 +1,45 @@
-added.h
+#include "mbed.h"
+#include "TFC.h"
+#include "XBEE.h"
+#include "testing.h"
+
+
+
+
+float testSpeed(float speed)
+{
+    // every time the car sees the stop start the speed of the car will increase
+    // this can occur on stop start trigger.
+    // may need to send the speed back to the telemetry.
+    if (speed>0.4)
+    {
+        speed+=0.05;
+     }
+     
+     else
+     {
+       speed+=0.1;   
+         
+     }   
+     
+     
+     sendString("s = %f", speed);
+     return speed;
+        
+}
+
+
+
+float lapTime(float newTime, float oldTime, int lapNo)
+{
+    // function which sends the lap time back to the telemetry.
+    
+    float laptime= newTime-oldTime;
+    float avgTime= newTime/lapNo;
+    
+    sendString("For lap number: %d  Lap Time: %f  Avergae time: %f ", lapNo,lapTime,avgTime);
+    
+    
+    return newTime;
+}
+