Skip to content

Commit

Permalink
Update examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
mobizt committed Oct 23, 2021
1 parent 3df9fd0 commit 20aab69
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
15 changes: 15 additions & 0 deletions examples/Basic/Basic.ino
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,21 @@ void loop()

Serial.printf("Get string... %s\n", Firebase.getString(fbdo, "/test/string") ? fbdo.to<const char *>() : fbdo.errorReason().c_str());

//For the usage of FirebaseJson, see examples/FirebaseJson/BasicUsage/Create.ino
FirebaseJson json;

if (count == 0)
{
json.set("value/round/" + String(count), "cool!");
json.set("vaue/ts/.sv", "timestamp");
Serial.printf("Set json... %s\n", Firebase.set(fbdo, "/test/json", json) ? "ok" : fbdo.errorReason().c_str());
}
else
{
json.add(String(count), "smart!");
Serial.printf("Update node... %s\n", Firebase.updateNode(fbdo, "/test/json/value/round", json) ? "ok" : fbdo.errorReason().c_str());
}

Serial.println();

//For generic set/get functions.
Expand Down
15 changes: 15 additions & 0 deletions examples/BasicCert/BasicCert.ino
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,21 @@ void loop()

Serial.printf("Get string... %s\n", Firebase.getString(fbdo, "/test/string") ? fbdo.to<const char *>() : fbdo.errorReason().c_str());

//For the usage of FirebaseJson, see examples/FirebaseJson/BasicUsage/Create.ino
FirebaseJson json;

if (count == 0)
{
json.set("value/round/" + String(count), "cool!");
json.set("vaue/ts/.sv", "timestamp");
Serial.printf("Set json... %s\n", Firebase.set(fbdo, "/test/json", json) ? "ok" : fbdo.errorReason().c_str());
}
else
{
json.add(String(count), "smart!");
Serial.printf("Update node... %s\n", Firebase.updateNode(fbdo, "/test/json/value/round", json) ? "ok" : fbdo.errorReason().c_str());
}

Serial.println();

//For generic set/get functions.
Expand Down
15 changes: 15 additions & 0 deletions examples/BasicEthernet/BasicEthernet.ino
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,21 @@ void testFirebase()

Serial.printf("Get string... %s\n", Firebase.getString(fbdo, "/test/string") ? fbdo.to<const char *>() : fbdo.errorReason().c_str());

//For the usage of FirebaseJson, see examples/FirebaseJson/BasicUsage/Create.ino
FirebaseJson json;

if (count == 0)
{
json.set("value/round/" + String(count), "cool!");
json.set("vaue/ts/.sv", "timestamp");
Serial.printf("Set json... %s\n", Firebase.set(fbdo, "/test/json", json) ? "ok" : fbdo.errorReason().c_str());
}
else
{
json.add(String(count), "smart!");
Serial.printf("Update node... %s\n", Firebase.updateNode(fbdo, "/test/json/value/round", json) ? "ok" : fbdo.errorReason().c_str());
}

Serial.println();

//For generic set/get functions.
Expand Down

0 comments on commit 20aab69

Please sign in to comment.