pour olivier

Dependencies:   RTC-DS1307 mbed

Fork of Rtc_Ds1307_Sample by Henry Leinen

Revision:
3:79b8df1189ea
Parent:
2:3be003301107
--- 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