Assignment 5 for OCE360, timers, tickers, and interrupts.
Dependencies: 4DGL-uLCD-SE MMA8452Q SDFileSystem bouncing_ball mbed
Fork of OCE360_4 by
Diff: main.cpp
- Revision:
- 11:abfb94de3a41
- Parent:
- 10:1fe988d4e61e
- Child:
- 12:1b20c6eceae8
diff -r 1fe988d4e61e -r abfb94de3a41 main.cpp --- a/main.cpp Wed Nov 15 21:53:17 2017 +0000 +++ b/main.cpp Thu Nov 16 15:01:30 2017 +0000 @@ -149,9 +149,11 @@ } // Tell the user we need to wait while we collect some data pc.printf("\nCollecting data (Do not remove SD Card!) ...\n\r"); + logtimer.start(); fprintf(file, " Time X Position Y Position X Accleration Y Acceleration Temperature\n\r"); - + //logticker.attach(&datarecord,LCD_UPDATE); pc.printf("\nData Recorded Sucessfully! \n\r"); + logtimer.reset(); // Close file fclose(file); @@ -200,14 +202,10 @@ float spe2x = 1*ball2.speedx; float spe2y = 1*ball2.speedy; - - logtimer.start(); voltage_in = tempin * 3.3; degrees_c = (voltage_in - 0.5) * 100.0; fprintf(file, "Ball 1: %.3g %.3g %.3g %.3g %.3g %.3g %.3g %.3g\n\r",time,pos1x,pos1y,spe1x,spe1y,accx,accy,degrees_c); fprintf(file, "Ball 2: %.3g %.3g %.3g %.3g \n\r",pos2x,pos2y,spe2x,spe2y); - - logtimer.reset(); } \ No newline at end of file