質問編集履歴
2
誤字
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ar
|
1
|
+
arduinoを使っています。初めての質問です。お願いいたします。
|
test
CHANGED
File without changes
|
1
加筆しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -35,3 +35,163 @@
|
|
35
35
|
どちらも、条件の設定の仕方がわかりません。
|
36
36
|
|
37
37
|
初心者で、質問の体すらなってないかもわかりませんが、アドバイスをよろしくお願いいたします。
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
現状はBLYNKのすけっちのみです。
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
``` /**************************************************************
|
46
|
+
|
47
|
+
* Blynk is a platform with iOS and Android apps to control
|
48
|
+
|
49
|
+
* Arduino, Raspberry Pi and the likes over the Internet.
|
50
|
+
|
51
|
+
* You can easily build graphic interfaces for all your
|
52
|
+
|
53
|
+
* projects by simply dragging and dropping widgets.
|
54
|
+
|
55
|
+
*
|
56
|
+
|
57
|
+
* Downloads, docs, tutorials: http://www.blynk.cc
|
58
|
+
|
59
|
+
* Blynk community: http://community.blynk.cc
|
60
|
+
|
61
|
+
* Social networks: http://www.fb.com/blynkapp
|
62
|
+
|
63
|
+
* http://twitter.com/blynk_app
|
64
|
+
|
65
|
+
*
|
66
|
+
|
67
|
+
* Blynk library is licensed under MIT license
|
68
|
+
|
69
|
+
* This example code is in public domain.
|
70
|
+
|
71
|
+
*
|
72
|
+
|
73
|
+
**************************************************************
|
74
|
+
|
75
|
+
* This example runs directly on ESP8266 chip.
|
76
|
+
|
77
|
+
*
|
78
|
+
|
79
|
+
* You need to install this for ESP8266 development:
|
80
|
+
|
81
|
+
* https://github.com/esp8266/Arduino
|
82
|
+
|
83
|
+
*
|
84
|
+
|
85
|
+
* Please be sure to select the right ESP8266 module
|
86
|
+
|
87
|
+
* in the Tools -> Board menu!
|
88
|
+
|
89
|
+
*
|
90
|
+
|
91
|
+
* Change WiFi ssid, pass, and Blynk auth token to run :)
|
92
|
+
|
93
|
+
*
|
94
|
+
|
95
|
+
**************************************************************/
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
|
100
|
+
|
101
|
+
#include <ESP8266WiFi.h>
|
102
|
+
|
103
|
+
#include <BlynkSimpleEsp8266.h>
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
// You should get Auth Token in the Blynk App.
|
108
|
+
|
109
|
+
// Go to the Project Settings (nut icon).
|
110
|
+
|
111
|
+
char auth[] = "********************";
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
// Your WiFi credentials.
|
116
|
+
|
117
|
+
// Set password to "" for open networks.
|
118
|
+
|
119
|
+
char ssid[] = "";
|
120
|
+
|
121
|
+
char pass[] = "**********";
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
void setup()
|
126
|
+
|
127
|
+
{
|
128
|
+
|
129
|
+
Serial.begin(9600);
|
130
|
+
|
131
|
+
Blynk.begin(auth, ssid, pass);
|
132
|
+
|
133
|
+
}
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
void loop()
|
138
|
+
|
139
|
+
{
|
140
|
+
|
141
|
+
Blynk.run();
|
142
|
+
|
143
|
+
}
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
```
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
自分としては、条件が満たされたとき、
|
152
|
+
|
153
|
+
例えば、ヴァーチャルピンがlowからHIGHになったとき、
|
154
|
+
|
155
|
+
下記のように作動させればよいのではないかと考えていました。
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
Serial.print("open\n");
|
160
|
+
|
161
|
+
digitalWrite(13, HIGH);
|
162
|
+
|
163
|
+
delay(100);
|
164
|
+
|
165
|
+
digitalWrite(13, LOW);
|
166
|
+
|
167
|
+
delay(100);
|
168
|
+
|
169
|
+
digitalWrite(14, HIGH);
|
170
|
+
|
171
|
+
delay(100);
|
172
|
+
|
173
|
+
digitalWrite(14, LOW);
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
break;
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
補足ですが、
|
182
|
+
|
183
|
+
自宅のパナソニックのインターホンから、子機登録したandroid携帯を、
|
184
|
+
|
185
|
+
teamviewerでリモートコントロールして、外部から開錠施錠することができるようになっています。これはPCのみです。
|
186
|
+
|
187
|
+
携帯端末から携帯端末のリモートコントロールができないためです。
|
188
|
+
|
189
|
+
この開錠施錠利用目的のみで設置してあるスマホをリレータッチボードでコントロールしようとしています。
|
190
|
+
|
191
|
+
一つ目のtouchで開錠ボタンを押して、二つ目のタッチでokボタンをクリックさせます。
|
192
|
+
|
193
|
+
ok・キャンセルのダイアログが必ず出るためです。
|
194
|
+
|
195
|
+
これをワンボタンで処理できないかというのが、今回の質問の主旨です。
|
196
|
+
|
197
|
+
よろしくお願いいたします。
|