mirror of
https://github.com/BitMaker-hub/NerdMiner_v2.git
synced 2025-03-17 13:21:51 +01:00
commit
c5f1e2d295
@ -462,7 +462,7 @@ void esp32_2432S028R_BTCprice(unsigned long mElapsed)
|
||||
// Delete sprite to free the memory heap
|
||||
background.deleteSprite();
|
||||
|
||||
createBackgroundSprite(169,105);
|
||||
createBackgroundSprite(180,105);
|
||||
// Print background screen
|
||||
background.pushImage(-130, -3, priceScreenWidth, priceScreenHeight, priceScreen);
|
||||
|
||||
|
@ -157,7 +157,9 @@ String getBTCprice(void){
|
||||
|
||||
DynamicJsonDocument doc(1024);
|
||||
deserializeJson(doc, payload);
|
||||
if (doc.containsKey("last_trade_price")) bitcoin_price = doc["last_trade_price"];
|
||||
if (doc.containsKey("bpi") && doc["bpi"].containsKey("USD")) {
|
||||
bitcoin_price = doc["bpi"]["USD"]["rate_float"].as<unsigned int>();
|
||||
}
|
||||
|
||||
doc.clear();
|
||||
|
||||
@ -168,7 +170,7 @@ String getBTCprice(void){
|
||||
} catch(...) {
|
||||
http.end();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (String(bitcoin_price) + "$");
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
#define UPDATE_PERIOD_h 5
|
||||
|
||||
//API BTC price (Update to USDT cus it's more liquidity and flow price updade)
|
||||
#define getBTCAPI "https://api.blockchain.com/v3/exchange/tickers/BTC-USDT"
|
||||
#define getBTCAPI "https://api.coindesk.com/v1/bpi/currentprice.json"
|
||||
#define UPDATE_BTC_min 1
|
||||
|
||||
//API Block height
|
||||
|
Loading…
x
Reference in New Issue
Block a user