Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit 1ef1d06

Browse files
committed
# This is a combination of 2 commits.
# The first commit's message is: Update FirebaseStream_ESP8266.ino # This is the 2nd commit message: Fix parsing of returned json object. The json object now has multiple values in data{}. Changing the code to pull the "last" value.
1 parent 2723c05 commit 1ef1d06

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/FirebaseStream_ESP8266/FirebaseStream_ESP8266.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <Adafruit_SSD1306.h>
2323
#include <ArduinoJson.h>
2424

25-
#define OLED_RESET 10
25+
#define OLED_RESET 3
2626
Adafruit_SSD1306 display(OLED_RESET);
2727

2828
Firebase fbase("publicdata-cryptocurrency.firebaseio.com");
@@ -65,7 +65,7 @@ void loop() {
6565
Serial.println(event);
6666
JsonObject& json = buf.parseObject((char*)event.c_str());
6767
String path = json["path"];
68-
float data = json["data"];
68+
float data = json["data"]["last"];
6969

7070
// TODO(proppy): parse JSON object.
7171
display.clearDisplay();

0 commit comments

Comments
 (0)