1
1
#include < NefryIFTTT.h>
2
- #include < NefryLineNotify.h>
3
- #include < WiFiClientSecure.h>
2
+ #include < NefryLineNotify.h>
3
+ #include < WiFiClientSecure.h>
4
4
5
- String Event, SecretKey, LineAuth, SendMessageLINE;
5
+ String Event, SecretKey, LineAuth, SendMessageLINE;
6
6
7
- void setup () {
8
- Nefry.setStoreTitle (" SecretKey" , 0 ); // Nefry DataStoreのタイトルを指定
9
- Nefry.setStoreTitle (" Event" , 1 ); // Nefry DataStoreのタイトルを指定
10
- Nefry.setStoreTitle (" LINE Auth" , 2 ); // Nefry DataStoreのタイトルを指定
11
- Nefry.setStoreTitle (" LINEMessage" , 3 ); // Nefry DataStoreのタイトルを指定
7
+ void setup () {
8
+ Nefry.setStoreTitle (" SecretKey" , 0 ); // Nefry DataStoreのタイトルを指定
9
+ Nefry.setStoreTitle (" Event" , 1 ); // Nefry DataStoreのタイトルを指定
10
+ Nefry.setStoreTitle (" LINE Auth" , 2 ); // Nefry DataStoreのタイトルを指定
11
+ Nefry.setStoreTitle (" LINEMessage" , 3 ); // Nefry DataStoreのタイトルを指定
12
12
13
- SecretKey = Nefry.getStoreStr (0 ); // Nefry DataStoreからデータを取得
14
- Event = Nefry.getStoreStr (1 ); // Nefry DataStoreからデータを取得
15
- LineAuth = Nefry.getStoreStr (2 ); // Nefry DataStoreからデータを取得
16
- SendMessageLINE = Nefry.getStoreStr (3 ); // Nefry DataStoreからデータを取得
13
+ SecretKey = Nefry.getStoreStr (0 ); // Nefry DataStoreからデータを取得
14
+ Event = Nefry.getStoreStr (1 ); // Nefry DataStoreからデータを取得
15
+ LineAuth = Nefry.getStoreStr (2 ); // Nefry DataStoreからデータを取得
16
+ SendMessageLINE = Nefry.getStoreStr (3 ); // Nefry DataStoreからデータを取得
17
17
18
- Nefry.enableSW (); // スイッチ有効化
19
- Nefry.setProgramName (" NefryBT Default Program" );// プログラム名登録
20
- }
18
+ Nefry.enableSW (); // スイッチ有効化
19
+ Nefry.setProgramName (" NefryBT Default Program" );// プログラム名登録
20
+ }
21
21
22
- void loop () {
23
- if (Nefry.readSW ()) { // スイッチを押した時
24
- if (!SecretKey.equals (" " ) && !Event.equals (" " )) {
25
- if (!IFTTT.send (Event, SecretKey)) {// IFTTTにデータを送信
26
- Nefry.setLed (255 , 0 , 0 ); // Errの時、赤色点灯
27
- }
28
- }
29
- if (!LineAuth.equals (" " )) {
30
- if (SendMessageLINE.equals (" " ))
31
- SendMessageLINE = " Welcome to the NefryBT world!" ;
32
- LineNotify.send (L
33
- FeineAuth,SendMessageLINE); // LINE送信
22
+ void loop () {
23
+ if (Nefry.readSW ()) { // スイッチを押した時
24
+ if (!SecretKey.equals (" " ) && !Event.equals (" " )) {
25
+ if (!IFTTT.send (Event, SecretKey)) {// IFTTTにデータを送信
26
+ Nefry.setLed (255 , 0 , 0 ); // Errの時、赤色点灯
34
27
}
35
- delay (1000 ); // 送信後1秒間待つ
36
28
}
37
- Nefry.setLed (random (255 ), random (255 ), random (255 ));
38
- delay (500 ); // 送信後0.5秒間待つ
29
+ if (!LineAuth.equals (" " )) {
30
+ if (SendMessageLINE.equals (" " ))
31
+ SendMessageLINE = " Welcome to the NefryBT world!" ;
32
+ LineNotify.send (L
33
+ FeineAuth, SendMessageLINE); // LINE送信
34
+ }
35
+ delay (1000 ); // 送信後1秒間待つ
39
36
}
37
+ Nefry.setLed (random (255 ), random (255 ), random (255 ));
38
+ delay (500 ); // 送信後0.5秒間待つ
39
+ }
0 commit comments