arduino-coinmarketcap-api
arduino-coinmarketcap-api copied to clipboard
Using deprecated json libraries
This need to be updated to use ArduinoJson 5
..\Arduino\libraries\CoinMarketCapApi\src\CoinMarketCapApi.cpp:70:11: error: DynamicJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
DynamicJsonBuffer jsonBuffer;
^
Replace
DynamicJsonBuffer jsonBuffer;
JsonArray& root = jsonBuffer.parseArray(response);
with:
DynamicJsonDocument root(1024);
DeserializationError error = deserializeJson(root, response);
and on error:
if(error){
responseObject.error = error.c_str();
} // else is success
That will allow you to compile; however, the library is still obsolete until it is updated to use coinmarketcap pro/basic plan. Meaning, you have to create an account and use an API key, and update the code. Resolution is really to use an open exchange like binance to stream prices.
Would it be possible to link me to a code in order to do this? I'm no programmer, I can just follow step by step instructions. I'd really like to get my ticker working, but dont understand what needs to be done in order to do it with something other than coinmarketcap.......has anyone updated the code working?
The code has not been updated except that of Json to version 6. What ticker do you have? If AFKdata, you could update to their code for free. There is also the rollercoaster code which is freeware. Also, M5 stacker which is free as well.
Basically, it depends on the ticker you have.
Michail www.VoltageGoat.com