如何解决我需要帮助在 arduino 上使用 indexof()
我已经设法从 coinbase api https://api.coindesk.com/v1/bpi/currentprice.json
获取我需要的字符串中的数据但我只能得到美元价格,使用 indexOf("rate_float"); 它返回第一个 rate_float,但如何获得欧元的利率浮动?
// Get rate as float
int rateIndex = jsonAnswer.indexOf("rate_float");
String priceString = jsonAnswer.substring(rateIndex + 12,rateIndex + 18);
priceString.trim();
float price = priceString.toFloat();
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。