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: btbee m3pi_ng mbed FatFileSystemCpp
Diff: USBTest.cpp
- Revision:
- 16:b09cc5b75049
- Parent:
- 15:62648eb5df9f
- Child:
- 17:b9608f93ea06
--- a/USBTest.cpp Fri May 29 13:19:37 2015 +0000
+++ b/USBTest.cpp Fri May 29 13:35:35 2015 +0000
@@ -88,17 +88,17 @@
float current_pos_of_line = 0.0;
float previous_pos_of_line = 0.0;
float derivative,proportional,integral = 0;
- float power;
+ double power;
float speed = MAX;
int LapTest[5];
int s1, s2, s3, s4, s5;
int counter = -1;
int checkvar = 0;
double Time1, Time2, Time3, Time4, Time5, TimeAve;
- vector < float > ZeTimes(2);
- vector < vector < float > > Data(500);
- float stuff;
- float junk;
+ vector < double > ZeTimes(2);
+ vector < vector < double > > Data;
+ double stuff;
+ double junk;
double timer;
double TimeToWrite;
int loopcounter = 0;
@@ -225,7 +225,7 @@
ZeTimes[0]= stuff;
ZeTimes[1] = power;
- Data[loopcounter] = ZeTimes;
+ Data.push_back(ZeTimes);
loopcounter++;
@@ -238,7 +238,7 @@
timer = 0;
LoopTime.reset();
- if (loopcounter == 500) {
+ if (loopcounter == 10) {
m3pi.stop();
m3pi.cls();
m3pi.locate(0,0);
@@ -263,7 +263,7 @@
m3pi.leds(1);
}
- for(int i = 0; i < 500; i++) {
+ for(int i = 0; i < 10; i++) {
for( int j = 0; j < 2; j++) {
@@ -277,6 +277,7 @@
}
+ m3pi.cls();
TimeToWrite = WriteTime.read();
btbee.printf("%f \n", TimeToWrite);
WriteTime.reset();