Schüler NWT / Mbed 2 deprecated WF_RTC

Dependencies:   LM75B mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 /*M0-BOARD LPC11U24 VERSION 1.0 WF 01_2015
00002 BULME Graz / Elektronik
00003 
00004 Polling eines Tasters
00005 
00006 Datei: WF_taster_polling/main.cpp
00007 
00008 */
00009 
00010 #include "mbed.h"
00011  
00012 int main() {
00013     while(1) {
00014         time_t seconds = time(NULL);
00015  
00016         printf("Time as seconds since January 1, 1970 = %d\n", seconds);
00017  
00018         printf("Time as a basic string = %s", ctime(&seconds));
00019  
00020         char buffer[32];
00021         strftime(buffer, 32, "%I:%M %p\n", localtime(&seconds));
00022         printf("Time as a custom formatted string = %s", buffer);
00023  
00024         wait(1);
00025     }
00026 }