Hi!
I am trying to parse my Json object, however, the values that are being returned are 0. Here is my code:
float price = 100.0;
float change = 100.0;
WiFiClient client;
HTTPClient http;
String command = "http://passiveincomeconsultingllc.com/getStockPrices.php?stock=" + stockArguments[i];
http.begin(client,command);
int httpCode = http.GET();
if (httpCode > 0) { //Check the returning code
String payload = http.getString();
JsonObject& root = jsonBuffer.parseObject(payload );
price = root["price"];
change = root["percent_change"];
When I display the "payload" I get
{"price":500,"percent_change":5}
Which is correct, but When I try setting the price and percent_change variable in my Arduino code it returns 0.0?
Is it an issue with declaration of variables?