src/main.cpp
/**************************************************************************************************************************/
// parse the JSON response from the ETHEREUM API
/**************************************************************************************************************************/
parse the JSON response from the ETHEREUM API
parse the JSON response from the ETHEREUM API
void parseCryptoJson( String json ) {
  DynamicJsonDocument doc(2048);
  DeserializationError error = deserializeJson(doc, json);
  if (error){
    Serial.println(error.c_str());
  }
  myCryptoData.ethereumPrice = doc["data"]["ETH"]["quote"]["USD"]["price"];
  myCryptoData.bitcoinPrice = doc["data"]["BTC"]["quote"]["USD"]["price"];
}
void parseCryptoJson ( String json ) { DynamicJsonDocument doc ( 2048 ) ; DeserializationError error = deserializeJson ( doc , json ) ; if ( error ) { Serial . println ( error . c_str ( ) ) ; } myCryptoData . ethereumPrice = doc [ " " ] [ " " ] [ " " ] [ " " ] [ " " ] ; myCryptoData . bitcoinPrice = doc [ " " ] [ " " ] [ " " ] [ " " ] [ " " ] ; }
parse the JSON response from the ETHEREUM API
parse the JSON response from the ETHEREUM API