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 SDFileSystem
Diff: main.cpp
- Revision:
- 3:39d578e9ce10
- Parent:
- 2:57bffc6f5df3
- Child:
- 4:ff1ea24ef19a
--- a/main.cpp Tue Apr 19 03:07:19 2016 +0000
+++ b/main.cpp Tue Apr 19 06:12:05 2016 +0000
@@ -11,11 +11,11 @@
FILE *fileRed;
FILE *filePurple;
bool mountFailure;
-int test_time = 10; //Length of test in seconds
+int test_time = 600; //Length of test in seconds
void writeData();
DigitalOut led1(LED1); //Mbed LED for SD Card Verification
-DigitalOut Red(p17); //Red LED in Pod
-DigitalOut Purple(p18); //Purple LED in Pod
+DigitalOut Red(p17); //Red LED in Pod (to transitor)
+DigitalOut Purple(p18); //Purple LED in Pod (to transitor)
int main()
{
@@ -55,8 +55,9 @@
Red = 0;
wait(1);
Purple = 0;
- Red = 1;
+ Red = 1;
wait(1);
+
}
sampleTime.detach();
fclose(fileRed);
@@ -72,7 +73,8 @@
void writeData()
{
- /* double sum = 0;
+ taverage.start();
+ double sum = 0;
for(int i=0;i<10;i++) //Takes 10 data points per second and finds average
{ //Hoping to avoid the waves created by 60 Hz noise in lab
if(taverage.read()>=.1)
@@ -83,11 +85,11 @@
}
double average = sum/10;
- */
+ //pc.printf("Time %.2f /t %.4f V\r\n", t.read(), 3.3*average);
if(Red==1)
{
- fprintf(fileRed, "%.2f \t %.4f\n\r", t.read(), 3.3*pot.read()); //Standard file input
+ fprintf(fileRed, "%.2f \t %.4f\n\r", t.read(), 3.3*average); //Standard file input
}
else
- fprintf(filePurple, "%.2f \t %.4f\n\r", t.read(), 3.3*pot.read()); //Standard file input
+ fprintf(filePurple, "%.2f \t %.4f\n\r", t.read(), 3.3*average); //Standard file input
}
\ No newline at end of file
