Hi,
I am just starting my adventure with Arduino.
I have a problem with displaying data from firebase on Serial Port. I want to do this firstly to check value of one of my variable called ‘switch’.
When I upload my program then in Serial window I see only black diamonds with question mark… I read that i must decode json before display but I do not have much expiernce in json data and I didn’t found any easy to understand example.
#include <ArduinoJson.h>
#include <Bridge.h>
#include <HttpClient.h>
#include <SPI.h>
#include <Ethernet.h>
void setup() {
pinMode(13, OUTPUT);
digitalWrite(13, LOW);
Bridge.begin();
digitalWrite(13, HIGH);
int index=0;
Serial.begin(9600);
while (!Serial); // wait for a serial connection
}
void loop() {
// Initialize the client library
HttpClient client;
// Make a HTTP request:
client.get(“https://myproject.firebaseio.com/switch.json?print=pretty”);
// if there are incoming bytes available
// from the server, read them and print them:
while (client.available()) {
char c = client.read();
Serial.println(c);
}
Serial.flush();
delay(5000);
}