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

Commit02db961

Browse files
committed
Fixed examples
1 parent41b56b4 commit02db961

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

‎examples/FirebaseStream_ESP8266/FirebaseStream_ESP8266.ino‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include<ESP8266WiFi.h>
2222
#include<Adafruit_GFX.h>
2323
#include<Adafruit_SSD1306.h>
24-
#include<ArduinoJson.h>
2524

2625
#defineOLED_RESET3
2726
Adafruit_SSD1306display(OLED_RESET);
@@ -66,8 +65,8 @@ void loop() {
6665
Serial.println(event);
6766
JsonObject& json = buf.parseObject((char*)event.c_str());
6867
String path = json["path"];
69-
float data = json["data"];
70-
68+
float data = json["data"];
69+
7170
// TODO(proppy): parse JSON object.
7271
display.clearDisplay();
7372
display.setTextSize(2);

‎examples/Firebase_ESP8266_LEDs/Firebase_ESP8266_Neopixel/Firebase_ESP8266_Neopixel.ino‎

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,8 @@
2626
constint PIN=13;
2727
Adafruit_NeoPixel strip = Adafruit_NeoPixel(32, PIN, NEO_GRB + NEO_KHZ800);
2828

29-
#defineJSON_BUFFER_SIZE10*4
30-
3129
// TODO: Replace with your own credentials and keep these safe.
32-
Firebase fbase = Firebase("YOUR-PROJECT.firebaseio.com")
33-
.auth("YOUR_AUTH_SECRET");
30+
Firebase fbase = Firebase("YOUR-PROJECT.firebaseio.com","YOUR_AUTH_SECRET");
3431

3532
voidsetup() {
3633
Serial.begin(9600);
@@ -75,14 +72,8 @@ void loop() {
7572
return;
7673
}
7774

78-
// Use dynamic for large JSON objects
79-
// DynamicJsonBuffer jsonBuffer;
80-
StaticJsonBuffer<JSON_OBJECT_SIZE(JSON_BUFFER_SIZE)> jsonBuffer;
81-
8275
// create an empty object
83-
String ref = get.json();
84-
Serial.println(ref);
85-
JsonObject& pixelJSON = jsonBuffer.parseObject((char*)ref.c_str());
76+
const JsonObject& pixelJSON = get.json();
8677

8778
if(pixelJSON.success()){
8879
for (int i=0; i < strip.numPixels(); i++) {
@@ -94,7 +85,7 @@ void loop() {
9485
strip.show();
9586
}else {
9687
Serial.println("Parse fail.");
97-
Serial.println(get.json());
88+
Serial.println(get.response());
9889
}
9990
}
10091

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp