hi rtc

Dependencies:   mbed

Fork of testing_rtc by saiteja dommeti

Revision:
2:c38929a198a7
Parent:
1:620887c20cee
--- a/rtc_tst.cpp	Sat Dec 20 10:30:39 2014 +0000
+++ b/rtc_tst.cpp	Sun Dec 21 09:56:03 2014 +0000
@@ -26,19 +26,19 @@
     //cs=0;
     
     spi.write(0x82);  
-    spi.write(0x15);  //write reg to hours (00-23)
+    spi.write(0x00);  //write reg to hours (00-23)
     
     spi.write(0x83);  
-    spi.write(0x07);  //write reg to day (1-7)
+    spi.write(0x00);  //write reg to day (1-7)
     
     spi.write(0x84);  
-    spi.write(0x20);  //write reg to date(01-31)
+    spi.write(0x00);  //write reg to date(01-31)
     
     spi.write(0x85);  
-    spi.write(0x12);  //write reg to mnth(01-12)
+    spi.write(0x00);  //write reg to mnth(01-12)
     
     spi.write(0x86);  
-    spi.write(0x12);  //write reg to year(00-99)
+    spi.write(0x00);  //write reg to year(00-99)
     
     cs=1;
     // Receive the contents of the seconds register
@@ -109,7 +109,7 @@
     char mi[3]=getstr(minutes);
     char s[3]=getstr(seconds);*/
     char time[15];
-    sprintf(time,"%d%d%d%d%d%d%d",year1,month1,date1,day1,hours1,minutes1,seconds1);
+    sprintf(time,"%2d%2d%2d%2d%2d%2d%2d",year1,month1,date1,day1,hours1,minutes1,seconds1);
     return(time);
     
 }