Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit13ce951

Browse files
committed
example/FirebasePush: update example to loop
1 parentbe1a7da commit13ce951

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

‎examples/FirebasePush_ESP8266/FirebasePush_ESP8266.ino

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@
1414
// limitations under the License.
1515
//
1616

17-
// FirebasePush_ESP8266 is a sample that push a newtimestamp tofirebase
18-
//on each reset.
17+
// FirebasePush_ESP8266 is a sample that push a newvalue toFirebase
18+
//every seconds.
1919

2020
#include<ESP8266WiFi.h>
21-
2221
#include<FirebaseArduino.h>
2322

2423
voidsetup() {
@@ -36,17 +35,19 @@ void setup() {
3635
Serial.println(WiFi.localIP());
3736

3837
Firebase.begin("example.firebaseio.com","auth_or_token");
38+
}
3939

40-
// add a new entry.
41-
String name = Firebase.push("/logs","{\".sv\":\"timestamp\"}");
40+
int n =0;
41+
42+
voidloop() {
43+
// push a new value.
44+
String name = Firebase.push("/logs", n++);
4245
if (Firebase.failed()) {
43-
Serial.println("push failed");
46+
Serial.print("push failed:");
4447
Serial.println(Firebase.error());
4548
return;
4649
}
4750
Serial.print("pushed:");
4851
Serial.println(name);
49-
}
50-
51-
voidloop() {
52+
delay(1000);
5253
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp