diff --git a/README.md b/README.md index 660837cf..3a11c190 100644 --- a/README.md +++ b/README.md @@ -1,50 +1,60 @@ +![ArduinoJson](banner.svg) + +--- + [![Build status](https://ci.appveyor.com/api/projects/status/m7s53wav1l0abssg/branch/master?svg=true)](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/master) [![Build Status](https://travis-ci.org/bblanchon/ArduinoJson.svg?branch=master)](https://travis-ci.org/bblanchon/ArduinoJson) [![Coverage Status](https://img.shields.io/coveralls/bblanchon/ArduinoJson.svg)](https://coveralls.io/r/bblanchon/ArduinoJson?branch=master) [![Star this project](http://githubbadges.com/star.svg?user=bblanchon&repo=ArduinoJson&style=flat&color=fff&background=007ec6)](https://github.com/bblanchon/ArduinoJson) -![ArduinoJson's logo](banner.svg) +ArduinoJson is a C++ JSON library for Arduino and IoT (Internet Of Things). -ArduinoJson - C++ JSON library for IoT -==================== - -*An elegant and efficient JSON library for embedded systems.* - -It's designed to have the most intuitive API, the smallest footprint and is able to work without any allocation on the heap (no malloc). - -It has been written with Arduino in mind, but it isn't linked to Arduino libraries so you can use this library in any other C++ project. -For instance, it supports Aduino's `String` and `Stream`, but also `std::string`, `std::istream` and `std::ostream`. - -Features --------- +## Features * JSON decoding (comments are supported) * JSON encoding (with optional indentation) -* Elegant API, very easy to use +* Elegant API, easy to use * Fixed memory allocation (zero malloc) * No data duplication (zero copy) -* Portable (written in C++98) +* Portable (written in C++98, can be used in any C++ project) * Self-contained (no external dependency) * Small footprint -* Header-only library -* MIT License +* Input and output streams +* [100% code coverage](https://coveralls.io/github/bblanchon/ArduinoJson) +* [Header-only library](https://en.wikipedia.org/wiki/Header-only) +* [MIT License](https://en.wikipedia.org/wiki/MIT_License) * [Comprehensive documentation](https://arduinojson.org) -Works on --------- +## Compatibility -* Arduino boards: Uno, Due, Mini, Micro, Yun... -* ESP8266, ESP32 -* Teensy -* RedBearLab boards (BLE Nano...) -* Intel Edison and Galileo -* WeMos boards: D1... -* Computers: Windows, Linux, OSX... -* PlatformIO -* Particle -* Energia +ArduinoJson works on the following hardware: -Quick start ------------ +* Arduino boards: [Uno](https://www.arduino.cc/en/Main/ArduinoBoardUno), [Due](https://www.arduino.cc/en/Main/ArduinoBoardDue), [Mini](https://www.arduino.cc/en/Main/ArduinoBoardMini), [Micro](https://www.arduino.cc/en/Main/ArduinoBoardMicro), [Yun](https://www.arduino.cc/en/Main/ArduinoBoardYun)... +* Espressif chips: [ESP8266](https://en.wikipedia.org/wiki/ESP8266), [ESP32](https://en.wikipedia.org/wiki/ESP32) +* WeMos boards: [D1](https://wiki.wemos.cc/products:d1:d1), [D1 mini](https://wiki.wemos.cc/products:d1:d1_mini), ... +* RedBearLab boards: [BLE Nano](http://redbearlab.com/blenano/), [BLE Mini](http://redbearlab.com/blemini/), [WiFi Micro](https://redbear.cc/product/wifi/wifi-micro.html), [LOLIN32](https://wiki.wemos.cc/products:lolin32:lolin32)... +* [Teensy](https://www.pjrc.com/teensy/) boards +* Intel boards: Edison, Galileo... +* Particle boards: [Photon](https://www.particle.io/products/hardware/photon-wifi-dev-kit), [Electron](https://www.particle.io/products/hardware/electron-cellular-dev-kit)... +* Texas Instruments boards: [MSP430](http://www.ti.com/microcontrollers/msp430-ultra-low-power-mcus/overview/overview.html)... -#### Decoding / Parsing +ArduinoJson compiles with zero warning on the following compilers, IDEs, and platforms: + +* [Arduino IDE](https://www.arduino.cc/en/Main/Software) +* [PlatformIO](http://platformio.org/) +* [Energia](http://energia.nu/) +* [Visual Micro](http://www.visualmicro.com/) +* [Atmel Studio](http://www.atmel.com/microsite/atmel-studio/) +* [IAR Embedded Workbench](https://www.iar.com/iar-embedded-workbench/) +* [Atollic TrueSTUDIO](https://atollic.com/truestudio/) +* [Keil uVision](http://www.keil.com/) +* [MPLAB X IDE](http://www.microchip.com/mplab/mplab-x-ide) +* [GCC](https://gcc.gnu.org/) +* [Clang](https://clang.llvm.org/) +* [Visual Studio](https://www.visualstudio.com/) + +## Quickstart + +### Deserialization + +Here is a program that parses a JSON document with ArduinoJson. ```c++ char json[] = "{\"sensor\":\"gps\",\"time\":1351824120,\"data\":[48.756080,2.302038]}"; @@ -59,11 +69,11 @@ double latitude = root["data"][0]; double longitude = root["data"][1]; ``` -[See JsonParserExample.ino](https://arduinojson.org/example/parser/) +See the [tutorial on arduinojson.org](http://arduinojson.org/doc/decoding/) -Use [ArduinoJson Assistant](https://arduinojson.org/assistant/) to compute the buffer size. +### Serialization -#### Encoding / Generating +Here is a program that generates a JSON document with ArduinoJson: ```c++ StaticJsonBuffer<200> jsonBuffer; @@ -81,52 +91,17 @@ root.printTo(Serial); // {"sensor":"gps","time":1351824120,"data":[48.756080,2.302038]} ``` -[See JsonGeneratorExample.ino](https://arduinojson.org/example/generator/) +See the [tutorial on arduinojson.org](http://arduinojson.org/doc/encoding/) -Use [ArduinoJson Assistant](https://arduinojson.org/assistant/) to compute the buffer size. +## Documentation +The documentation is available on [arduinojson.org](https://arduinojson.org/), here are some shortcuts: -Documentation -------------- - -The documentation is available online in the [ArduinoJson Website](https://arduinojson.org/). - -The [ArduinoJson Assistant](https://arduinojson.org/assistant/) helps you get started with the library. - - -Donators --------- - -Special thanks to the following persons and companies who made generous donations to the library author: - -* Robert Murphy USA -* Surge Communications USA -* Alex Scott United Kingdom -* Firepick Services LLC USA -* A B Doodkorte Netherlands -* Scott Smith USA -* Johann Stieger Austria -* Gustavo Donizeti Gini Brazil -* Charles-Henri Hallard France -* Martijn van den Burg Netherlands -* Nick Koumaris Greece -* Jon Williams USA -* Kestutis Liaugminas Lithuania -* Darlington Adibe Nigeria -* Yoeri Kroon Netherlands -* Andrew Melvin United Kingdom -* Doanh Luong Vietnam -* Christoph Schmidt Germany -* OpenEVSE LLC USA -* Prokhoryatov Alexey Russia -* Google Inc. USA -* Charles Haynes Australia -* Charles Walker USA -* Günther Jehle Liechtenstein -* Patrick Elliott -* Alexander Wilms Germany - +* The [Examples](https://arduinojson.org/example/) show how to use the library in various situations. +* The [API Reference](https://arduinojson.org/api/) contains the description of each class and function. +* The [FAQ](https://arduinojson.org/faq/) has the answer to virtually all questions. +* The [ArduinoJson Assistant](https://arduinojson.org/assistant/) writes programs for you! --- -Found this library useful? Please star this project or [help me back with a donation!](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=donate%40benoitblanchon%2efr&lc=GB&item_name=Benoit%20Blanchon&item_number=Arduino%20JSON¤cy_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted) :smile: +Do you like this library? Please [star this project on GitHub](https://github.com/bblanchon/ArduinoJson/stargazers)! \ No newline at end of file