Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
main.cpp
00001 #include "mbed.h" 00002 #include <time.h> 00003 //勉強会 00004 DigitalOut myled(LED1); 00005 00006 int main() { 00007 00008 printf("\r\nStruct\r\n"); 00009 time_t mk; 00010 struct tm tm_mk; 00011 struct tm *tm_lt; 00012 // 時間定義 2020/11/12 10:20:30 00013 tm_mk.tm_year = 2020 - 1900; 00014 tm_mk.tm_mon = 11 - 1; 00015 tm_mk.tm_mday = 12; 00016 tm_mk.tm_hour = 10; 00017 tm_mk.tm_min = 20; 00018 tm_mk.tm_sec = 30; 00019 mk = mktime(&tm_mk); 00020 printf("mktime:%d\r\n", mk); 00021 set_time(mk); 00022 tm_lt = localtime(&mk); 00023 printf("日付 - %04d/%02d/%02d\r\n", tm_lt->tm_year + 1900, tm_lt->tm_mon + 1, tm_lt->tm_mday); 00024 printf("時刻 - %02d:%02d:%02d\r\n", tm_lt->tm_hour, tm_lt->tm_min, tm_lt->tm_sec); 00025 00026 // mk=time(NULL); 00027 00028 while(1) { 00029 wait(1); 00030 myled = !myled; 00031 //時刻表示しよう 00032 } 00033 }
Generated on Fri Aug 26 2022 00:12:24 by
1.7.2