mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-17 04:22:18 +02:00
Writing documentation...
This commit is contained in:
@ -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
|
|
@ -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.
|
@ -1,5 +1,11 @@
|
|||||||
Generating JSON with Arduino JSON
|
Generating JSON with Arduino JSON
|
||||||
==============================
|
=================================
|
||||||
|
|
||||||
|
Before writing any code, don't forget to include the header:
|
||||||
|
|
||||||
|
#include <ArduinoJson.h>
|
||||||
|
|
||||||
|
If your not using the Arduino IDE, please read [Using the library without Arduino](Using the library without Arduino.md).
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
31
doc/Using the library with Arduino.md
Normal file
31
doc/Using the library with Arduino.md
Normal file
@ -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:
|
||||||
|
|
||||||
|
<your Arduino Sketch folder>/libraries/ArduinoJson
|
||||||
|
|
||||||
|
Then restart the Arduino IDE.
|
||||||
|
|
||||||
|
## Run the examples sketches
|
||||||
|
|
||||||
|
Click `File` / `Example` / `ArduinoJson`.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
## Use the library in your sketches
|
||||||
|
|
||||||
|
Just add the following line at the top of your program:
|
||||||
|
|
||||||
|
#include <ArduinoJson.h>
|
||||||
|
|
||||||
|
Then follow the instructions:
|
||||||
|
|
||||||
|
1. [Parsing JSON](Parsin JSON.md)
|
||||||
|
2. [Generating JSON](Generating JSON.md)
|
50
doc/Using the library without Arduino.md
Normal file
50
doc/Using the library without Arduino.md
Normal file
@ -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 `<arduino-json>`, you need to add:
|
||||||
|
|
||||||
|
1. `<arduino-json>/include` to your include path
|
||||||
|
2. `<arduino-json>/lib` to your library path
|
||||||
|
|
||||||
|
## Headers
|
||||||
|
|
||||||
|
The following headers are required:
|
||||||
|
|
||||||
|
#include <ArduinoJson/JsonArray.hpp>
|
||||||
|
#include <ArduinoJson/JsonObject.hpp>
|
||||||
|
#include <ArduinoJson/StaticJsonBuffer.hpp>
|
||||||
|
|
||||||
|
## 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)
|
Reference in New Issue
Block a user