pour olivier

Dependencies:   RTC-DS1307 mbed

Fork of Rtc_Ds1307_Sample by Henry Leinen

Files at this revision

API Documentation at this revision

Comitter:
mathieusab
Date:
Fri Dec 09 16:50:57 2016 +0000
Parent:
2:3be003301107
Commit message:
pour olivier

Changed in this revision

RTC-DS1307.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
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- a/RTC-DS1307.lib	Wed Jun 26 21:07:13 2013 +0000
+++ b/RTC-DS1307.lib	Fri Dec 09 16:50:57 2016 +0000
@@ -1,1 +1,1 @@
-https://mbed.org/users/leihen/code/RTC-DS1307/#5627b407e097
+https://developer.mbed.org/teams/RucheCo1/code/RTC-DS1307/#5627b407e097
--- a/main.cpp	Wed Jun 26 21:07:13 2013 +0000
+++ b/main.cpp	Fri Dec 09 16:50:57 2016 +0000
@@ -1,15 +1,19 @@
 #include "mbed.h"
 #include "Rtc_Ds1307.h"
 
+//pc_13 = SCL
+//pc_14 = SDA
+
 //RtcCls rtc(p28, p27, p29, true);
-Rtc_Ds1307 rtc(p28, p27);
+Rtc_Ds1307 rtc(PB_11, PB_10);
 
-Serial pc(USBTX, USBRX, "pc");
+Serial pc(USBTX, USBRX);
 
 char buffer[128];
 int readptr = 0;
 
 int main() {
+    pc.printf("coucou\n");
     char c;
     Rtc_Ds1307::Time_rtc tm = {};
     
@@ -39,6 +43,7 @@
         }
         else if (strncmp(buffer, "write", 5) == 0) {
             //  perform write
+            /*
             pc.printf("Enter the date (date 0..31)");
             pc.scanf("%d", &tm.date);
             pc.printf("Enter the date (month 1..12)");
@@ -52,10 +57,19 @@
             pc.printf("Enter the time (seconds 0..59)");
             pc.scanf("%d", &tm.sec);
             pc.printf("Performing write operation\n");
+            */
             
+            tm.date=2;
+            tm.mon=12;
+            tm.year=2016;
+            tm.hour=10;
+            tm.min=45;
+            tm.sec=50;
+            pc.printf("test 1\n");
             while(pc.readable()) 
                 pc.getc();
             rtc.setTime(tm, false, false);
+            pc.printf("test 2\n");
         }
         else if (strncmp(buffer, "start", 5) == 0) {
             //  start
--- a/mbed.bld	Wed Jun 26 21:07:13 2013 +0000
+++ b/mbed.bld	Fri Dec 09 16:50:57 2016 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/b3110cd2dd17
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/9296ab0bfc11
\ No newline at end of file