Relative Content

Daily Archives: 2017年10月31日

WeMos (c4) JSON

WeMosをRESPのクライアントとして機能するため、JSONと、HTTPClientを検証する。 ライブラリの追加 JSONを扱うライブラリに「ArduinoJSON」というのがあるので、ライブラリの追加で、リストが出てくるので、JSONと入力し絞込。 (2018/7現在、5.x と6.x が共存して、6.xはまたベター版のため、エラーが発生する。5.xを利用する) ArduinoJSONの動作、JsonBuffer size、Parsing program、Serializing programは、下記のURLで確認しながら進める方が便利でしょう。 https://bblanchon.github.io/ArduinoJson/assistant/ 動作確認 公式のサンプルJsonParserExampleをそのまんま。 // Copyright Benoit Blanchon 2014-2017 // MIT License // // Arduino JSON library // https://bblanchon.github.io/ArduinoJson/ // If you like this project, please add a star! #include <ArduinoJson.h> void setup() { Serial.begin(9600); while (!Serial) { // wait serial port initialization } // Memory […]