Armando Hernández
/
DS1302_HelloWorld
TEST_LP 1608
Revision 2:10b51af4fb8c, committed 2018-11-30
- Comitter:
- armandotill
- Date:
- Fri Nov 30 03:12:40 2018 +0000
- Parent:
- 1:e747c4ea86e0
- Child:
- 3:8c4b9d2adf7a
- Commit message:
- DS1302_TEST
Changed in this revision
DS1302.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 |
--- a/DS1302.lib Sat Feb 21 15:18:52 2015 +0000 +++ b/DS1302.lib Fri Nov 30 03:12:40 2018 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/Sissors/code/DS1302/#c7cea2a415c3 +http://mbed.org/users/Sissors/code/DS1302/#9a746f303e59
--- a/main.cpp Sat Feb 21 15:18:52 2015 +0000 +++ b/main.cpp Fri Nov 30 03:12:40 2018 +0000 @@ -1,6 +1,6 @@ -#define SCLK PTC5 -#define IO PTC4 -#define CE PTC3 +#define SCLK p22 +#define IO p23 +#define CE p24 //Comment this line if the DS1302 is already running #define INITIAL_RUN @@ -12,16 +12,16 @@ int main() { #ifdef INITIAL_RUN - clk.set_time(1256729737); + clk.set_time(2056729737); #endif char storedByte = clk.recallByte(0); - printf("\r\nStored byte was %d, now increasing by one\r\n", storedByte); + //printf("\r\nStored byte was %d, now increasing by one\r\n", storedByte); clk.storeByte(0, storedByte + 1); while(1) { time_t seconds = clk.time(NULL); - printf("Time as a basic string = %s\r", ctime(&seconds)); + printf("Fecha - Hora = %s\r", ctime(&seconds)); wait(1); } }