SPI,I2C,RTC
Dependencies: MFRC522_Updated ssd1306_library
Diff: main.cpp
- Revision:
- 1:fd4f40b923e7
- Parent:
- 0:fbda9e7e9269
- Child:
- 2:8083cd0c48a8
--- a/main.cpp Tue May 19 18:02:40 2020 +0000 +++ b/main.cpp Tue May 19 18:44:13 2020 +0000 @@ -1,4 +1,8 @@ #include "mbed.h" +#include "stdio.h" +#include "string.h" + +Serial pc(USBTX, USBRX); int main() { set_time(1589850133); @@ -6,13 +10,10 @@ while (true) { time_t seconds = time(NULL); - printf(" %u\n\r ", (unsigned int)seconds); + pc.printf(" %u\n\r ", (unsigned int)seconds); - printf("fecha %s\n\r", ctime(&seconds)); + pc.printf("fecha %s\n\r", ctime(&seconds)); - char buffer[32]; - strftime(buffer, 32, "%I:%M %p\n\r", localtime(&seconds)); - printf("Time as a custom formatted string = %s\n\r", buffer); wait(1); }