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
Diff: main.cpp
- Revision:
- 0:cb470cb42e12
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Fri Nov 13 04:02:01 2020 +0000
@@ -0,0 +1,33 @@
+#include "mbed.h"
+#include <time.h>
+//勉強会
+DigitalOut myled(LED1);
+
+int main() {
+
+ printf("\r\nStruct\r\n");
+ time_t mk;
+ struct tm tm_mk;
+ struct tm *tm_lt;
+// 時間定義 2020/11/12 10:20:30
+ tm_mk.tm_year = 2020 - 1900;
+ tm_mk.tm_mon = 11 - 1;
+ tm_mk.tm_mday = 12;
+ tm_mk.tm_hour = 10;
+ tm_mk.tm_min = 20;
+ tm_mk.tm_sec = 30;
+ mk = mktime(&tm_mk);
+ printf("mktime:%d\r\n", mk);
+ set_time(mk);
+ tm_lt = localtime(&mk);
+ printf("日付 - %04d/%02d/%02d\r\n", tm_lt->tm_year + 1900, tm_lt->tm_mon + 1, tm_lt->tm_mday);
+ printf("時刻 - %02d:%02d:%02d\r\n", tm_lt->tm_hour, tm_lt->tm_min, tm_lt->tm_sec);
+
+// mk=time(NULL);
+
+ while(1) {
+ wait(1);
+ myled = !myled;
+//時刻表示しよう
+ }
+}