Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: Calculate.cpp
- Revision:
- 51:210353276e06
- Parent:
- 50:d794595c6868
- Child:
- 52:d21fc7266b66
diff -r d794595c6868 -r 210353276e06 Calculate.cpp
--- a/Calculate.cpp Wed Jul 15 15:16:03 2015 +0000
+++ b/Calculate.cpp Wed Jul 15 15:39:10 2015 +0000
@@ -5,7 +5,7 @@
#include "Distance.h"
void printArray(double array[3], int timesArray[3]);
-void data(int sensor_number, int speed);
+void data(int sensor_number, int time, double speed);
//mbed pins
extern Serial pc; //defines the communication between MBed and pc
@@ -18,7 +18,7 @@
int timeDiff; //time between 2 sensors - not used right now
float speed;
int times[3]; //array the size of #pins
- double speeds[3]; //array of speeds
+ double speeds[3]; //array of speeds
int calculate(double distance)
{
pc.printf("new program \n"); //alert user of initialisation
@@ -60,7 +60,7 @@
}
for (int i = 0; i < 3 ; i++) //printing to Datalog
{
- data( i,speeds[i]);
+ data( i,times[i],speeds[i]);
}
}