From 2e47d546b29fa3382f6cee0c7ac03e45fb59534d Mon Sep 17 00:00:00 2001 From: Benoit Blanchon Date: Sat, 8 Nov 2014 15:48:51 +0100 Subject: [PATCH] Writing documentation... --- doc/Compiling without Arduino IDE.md | 15 ------- doc/Contributing.md | 15 +++++++ doc/Generating JSON.md | 8 +++- doc/Installing for Arduino.md | 0 doc/Using the library with Arduino.md | 31 +++++++++++++++ doc/Using the library without Arduino.md | 50 ++++++++++++++++++++++++ 6 files changed, 103 insertions(+), 16 deletions(-) delete mode 100644 doc/Compiling without Arduino IDE.md delete mode 100644 doc/Installing for Arduino.md create mode 100644 doc/Using the library with Arduino.md create mode 100644 doc/Using the library without Arduino.md diff --git a/doc/Compiling without Arduino IDE.md b/doc/Compiling without Arduino IDE.md deleted file mode 100644 index 910423c4..00000000 --- a/doc/Compiling without Arduino IDE.md +++ /dev/null @@ -1,15 +0,0 @@ -Compiling Arduino JSON -====================== - -Step 1: Download source code: - - git clone https://github.com/bblanchon/ArduinoJson.git - -Step 2: Generate the Makefile for your environment - - cd ArduinoJson - cmake . - -Step 3: Build - - make \ No newline at end of file diff --git a/doc/Contributing.md b/doc/Contributing.md index e69de29b..95886302 100644 --- a/doc/Contributing.md +++ b/doc/Contributing.md @@ -0,0 +1,15 @@ +Contributing to Arduino JSON +============================ + +If you want to contribute to the project, please: + +1. Use GitHub pull request feature +2. Follow the coding conventions +3. Write tests + +About the coding conventions: I try to follow the [Google C++ Style Guide](http://google-styleguide.googlecode.com/svn/trunk/cppguide.html) which few variations to match the Arduino conventions. + +I use [ClangFormat](http://clang.llvm.org/docs/ClangFormat.html) to format the code for me. +I use [CppLint](http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py) to detect non-compliant stuff. + +You should have a look at the `scripts/` folder as it contains a few helpers scripts. \ No newline at end of file diff --git a/doc/Generating JSON.md b/doc/Generating JSON.md index 1b2ff138..2edcdc71 100644 --- a/doc/Generating JSON.md +++ b/doc/Generating JSON.md @@ -1,5 +1,11 @@ Generating JSON with Arduino JSON -============================== +================================= + +Before writing any code, don't forget to include the header: + + #include + +If your not using the Arduino IDE, please read [Using the library without Arduino](Using the library without Arduino.md). ## Example diff --git a/doc/Installing for Arduino.md b/doc/Installing for Arduino.md deleted file mode 100644 index e69de29b..00000000 diff --git a/doc/Using the library with Arduino.md b/doc/Using the library with Arduino.md new file mode 100644 index 00000000..31efebc4 --- /dev/null +++ b/doc/Using the library with Arduino.md @@ -0,0 +1,31 @@ +Using the library without Arduino +================================= + +This library is primarily design to be used with the Arduino IDE and therefore has a simplified setup procedure for that purpose. +If you don't use the Arduino IDE, please read [Using the library without Arduino](Using the library without Arduino.md). + +## Install the library + +[Download the zip package](https://github.com/bblanchon/ArduinoJson/releases) and extract it to: + + /libraries/ArduinoJson + +Then restart the Arduino IDE. + +## Run the examples sketches + +Click `File` / `Example` / `ArduinoJson`. + +![Screen capture of Arduino IDE](http://i.imgur.com/g5UwkVh.png) + + +## Use the library in your sketches + +Just add the following line at the top of your program: + + #include + +Then follow the instructions: + +1. [Parsing JSON](Parsin JSON.md) +2. [Generating JSON](Generating JSON.md) \ No newline at end of file diff --git a/doc/Using the library without Arduino.md b/doc/Using the library without Arduino.md new file mode 100644 index 00000000..a9cc4170 --- /dev/null +++ b/doc/Using the library without Arduino.md @@ -0,0 +1,50 @@ +Using the library without Arduino +================================= + +This library is primarily design to be used with the Arduino IDE and therefore has a simplified setup procedure for that purpose. +If you use the Arduino IDE, please read [Using the library with Arduino](Using the library with Arduino.md). + +However, it can be used without Arduino IDE with very little effort. + +## Compiling the library + +Step 1: Download source code: + + git clone https://github.com/bblanchon/ArduinoJson.git + +Step 2: Generate the `Makefile` for your environment + + cd ArduinoJson + cmake . + +Step 3: Build + + make + +## File paths + +Assuming you installed the library into ``, you need to add: + +1. `/include` to your include path +2. `/lib` to your library path + +## Headers + +The following headers are required: + + #include + #include + #include + +## Namespace + +Every class of the library is declared in the `ArduinoJson` namespace, so you may want to add the following line after the `#include` statements: + + using namespace ArduinoJson; + +---------- + +You are now ready to follow the instructions: + +1. [Parsing JSON](Parsin JSON.md) +2. [Generating JSON](Generating JSON.md) \ No newline at end of file