High speed logging example

Dependencies:   Adafruit_RTCLib BNO055 SDFileSystem mbed

Files at this revision

API Documentation at this revision

Comitter:
bwang
Date:
Mon Jan 29 09:40:27 2018 +0000
Parent:
2:aaa32a8342ab
Child:
4:f3d3cb939d91
Commit message:
circular buffer works great

Changed in this revision

SDFileSystem.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
rtc_define.h Show annotated file Show diff for this revision Revisions of this file
--- a/SDFileSystem.lib	Wed Jan 24 22:06:46 2018 +0000
+++ b/SDFileSystem.lib	Mon Jan 29 09:40:27 2018 +0000
@@ -1,1 +1,1 @@
-http://os.mbed.com/users/mbed_official/code/SDFileSystem/#205da3832a79
+http://os.mbed.com/users/mbed_official/code/SDFileSystem/#874f88edace3
--- a/main.cpp	Wed Jan 24 22:06:46 2018 +0000
+++ b/main.cpp	Mon Jan 29 09:40:27 2018 +0000
@@ -14,6 +14,8 @@
 #define I2C1_SDA PB_9
 #define I2C1_SCL PB_8
 
+RtcDs1307 *rtc;
+
 char fname[255];
 char current_time[64];
 
@@ -82,10 +84,10 @@
     /*init RTC, get time and date for filename*/
     I2C i2c1(I2C1_SDA, I2C1_SCL);
     i2c1.frequency(100000);
-    RtcDs1307 rtc(i2c1);
+    rtc = new RtcDs1307(i2c1);
     
-    rtcUpdate(rtc, -(5*60*60));
-    DateTime dt = rtc.now();
+    rtcUpdate(*rtc, -(5*60*60));
+    DateTime dt = rtc->now();
     printDT("It is now", dt);
     
     strcpy(fname, "/sd/log_");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rtc_define.h	Mon Jan 29 09:40:27 2018 +0000
@@ -0,0 +1,8 @@
+#ifndef __RTC_DEFINE_H
+#define __RTC_DEFINE_H
+
+#include "DS1307.h"
+
+extern RtcDs1307 *rtc;
+
+#endif
\ No newline at end of file