M5stackでスマートウォッチをつくる?

143 Views

April 16, 20

スライド概要

IoT縛りの勉強会! IoTLT vol.62

profile-image

製造業で機械系エンジニアをやってます。IoT的なこともすこしやってます。

シェア

またはPlayer版

埋め込む »CMSなどでJSが使えない場合

関連スライド

各ページのテキスト
1.

m5stackで スマートウォッチをつくる? IoT縛りの勉強会! IoTLT vol.62 2020/4/16 @kyokucho_1989

2.

自己紹介 ・kyokucho1989 ・IoTが好き ・M5Stack楽しい ・広島在住 ・#人生逆転サロン メンター(IoT) twitter: @kyokucho_1989 blog: https://matoyomi.hatenablog.com 「マトリョーシカ的日常」 youtube: マトリョーシカ的IoTチャンネル #IoTLT @kyokucho_1989

3.

自己紹介 プッチ神父回路 (素数だけ数える) カップラーメン IoT タイマー (3分経ったらLINEにお知らせ) #IoTLT @kyokucho_1989

4.

本題:スマートウォッチをつくろう(?) #IoTLT @kyokucho_1989

5.

スマートウォッチ(一般的な) 通知 #IoTLT @kyokucho_1989 時計 ロギング

6.

スマートじゃないウォッチ的ななにか 通知 時計 ロギング 機能を絞る! (ハードルをものすっごい下げる!) #IoTLT @kyokucho_1989

7.

どんなシステム? 時刻データ NTPサーバー #IoTLT @kyokucho_1989 M5Stack サーボモータ

8.
[beta]
コードの一部(抜粋)

#include <M5Stack.h>
#include <WiFi.h>
#include <WiFiClient.h>
#include "time.h"
WiFiClient client;
const char* ssid = “****”;
const char* password = “***”;
const char* ntpServer = "ntp.jst.mfeed.ad.jp";
const long gmtOffset_sec = 3600L * 9;
const int daylightOffset_sec = 0;
int hh,mm,ss;

#IoTLT

@kyokucho_1989

void printLocalTime(){
struct tm timeinfo;
if(!getLocalTime(&timeinfo)){
Serial.println("Failed to obtain time");
return;
}
hh = timeinfo.tm_hour;
mm = timeinfo.tm_min;
ss = timeinfo.tm_sec;

Serial.println(&timeinfo);
}
void setup() {
Serial.begin(115200);
M5.begin(true, false, true);
delay(10);
}
void loop(){
delay(500);
printLocalTime();
}

9.
[beta]
コードの一部(抜粋)

#include <M5Stack.h>
#include <WiFi.h>
#include <WiFiClient.h>
#include "time.h"
WiFiClient client;
const char* ssid = “****”;
!getLocalTime()の後にやらないとss
const
char* password = “***”;
const char* ntpServer = "ntp.jst.mfeed.ad.jp";
が取得できなかった
const long gmtOffset_sec = 3600L * 9;
const int daylightOffset_sec = 0;
int hh,mm,ss;

ここがわからなかった

#IoTLT

@kyokucho_1989

void printLocalTime(){
struct tm timeinfo;
if(!getLocalTime(&timeinfo)){
Serial.println("Failed to obtain time");
return;
}
hh = timeinfo.tm_hour;
mm = timeinfo.tm_min;
ss = timeinfo.tm_sec;

Serial.println(&timeinfo);
}
void setup() {
Serial.begin(115200);
M5.begin(true, false, true);
delay(10);
}
void loop(){
delay(500);
printLocalTime();
}

10.

うごかしてみたよ。 #IoTLT @kyokucho_1989

11.

ご静聴、ありがとうございました。 #IoTLT @kyokucho_1989