its a library for testing the car

Dependencies:   FRDM-TFC

Files at this revision

API Documentation at this revision

Comitter:
lh14g13
Date:
Sun Dec 04 15:50:53 2016 +0000
Parent:
0:b9d22501052e
Commit message:
added iun two test, they dont compile due to needing to send string function

Changed in this revision

FRDM-TFC.lib Show annotated file Show diff for this revision Revisions of this file
testing.cpp Show annotated file Show diff for this revision Revisions of this file
testing.h Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/FRDM-TFC.lib	Sun Dec 04 15:50:53 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/emh203/code/FRDM-TFC/#24430a0d7fd8
--- 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;
+}
+
--- a/testing.h	Tue Nov 29 15:05:18 2016 +0000
+++ b/testing.h	Sun Dec 04 15:50:53 2016 +0000
@@ -9,10 +9,13 @@
 //what do we need to test?
 ////////////////////////////////////////////////////////////////////////////////
 
-
+float testSpeed(float speed);
 
 
 ////////////////////////LAP TIMES///////////////////////////////////////////////
+void lapTime();
+
+
 
 // have a test for increasing the speed per lap as well as average lap times at certain speeds
 // look at changing how the pid function will change it. VALIDATE THE PID DECISION
@@ -25,11 +28,6 @@
 
 
 
-///////////////////////MOTOR and SENSOR TESTS//////////////////////////////////
-
-
-
-// need to have car run on just duty cycle and with the motor speed sensors
 
 
 
@@ -37,5 +35,4 @@
 
 
 
-stuff has been added