如何修复 ArduinoJson 错误: 'ArduinoJson::JsonObject' has no member named 'printTo'
问题:
尝试使用 ArduinoJson 构建你的项目时,你看到类似这样的错误消息
example-2.cpp
root.printTo(*response);解决方案
你使用的代码是用于旧版本的 ArduinoJson:它是为 ArduinoJson 版本 5.x 编写的,而你使用的是 ArduinoJson 版本 6.x。使用 serializeJson() 代替 root.printTo(*response):
example-1.sh
有关需要替换哪些调用的更多信息,请参见官方 ArduinoJson 从版本 5 迁移到 6 的指南。
Check out similar posts by category:
Arduino, Embedded, ESP8266/ESP32, PlatformIO
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow