U8glib库:修訂版本之間的差異

出自YFRobotwiki
跳轉到: 導覽搜尋
(以“ [http://www.json.org/json-zh.html JSON 介绍] json library from [https://github.com/bblanchon/ArduinoJson github arduino Json] [https://github.com/bblanchon/...”为内容创建页面)
 
第 1 行: 第 1 行:
  
[http://www.json.org/json-zh.html JSON 介绍]
+
U8glib github: [https://github.com/olikraus/u8glib github U8glib]
  
 +
U8glib github: [https://code.google.com/archive/p/u8glib google U8glib]
  
 +
[https://github.com/bblanchon/ArduinoJson/wiki Github U8glib wiki] | [[论坛简介贴地址]]
  
json library from [https://github.com/bblanchon/ArduinoJson github arduino Json]
+
[https://github.com/olikraus/U8glib_Arduino/releases/tag/1.19.1 download U8glib_Arduino]
 
+
[https://github.com/bblanchon/ArduinoJson/wiki Github arduino json wiki] | [http://www.yfrobot.com/thread-11875-1-1.html JSON Library 论坛简介贴地址]
+
 
+
download from the address:[https://github.com/bblanchon/ArduinoJson/releases zip address]
+
  
 
{| border="0" cellpadding="10" width="100%"
 
{| border="0" cellpadding="10" width="100%"
 
|-
 
|-
 
|width="60%" valign="top" align="left"|
 
|width="60%" valign="top" align="left"|
Welcome to the user manual for the Arduino JSON library, an elegant and efficient JSON library for embedded systems.
+
A graphics library with support for many different monochrome displays.
  
It's designed to have the most intuitive API, the smallest footprint and works without any allocation on the heap (no malloc).
+
译:一个支持许多不同单色显示屏的图形库。
 +
<br>
  
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.
 
 
[https://github.com/bblanchon/ArduinoJson/wiki/Using%20the%20library%20with%20Arduino Using the library with Arduino]
 
 
<br>
 
  
 
<font color="orange" size="+2">'''Examples'''</font><br>
 
<font color="orange" size="+2">'''Examples'''</font><br>

2016年8月26日 (五) 09:25的修訂版本

U8glib github: github U8glib

U8glib github: google U8glib

Github U8glib wiki | 論壇簡介貼地址

download U8glib_Arduino

A graphics library with support for many different monochrome displays.

譯:一個支持許多不同單色顯示屏的圖形庫。


Examples

- IndentedPrintExample : Indented Print - 縮進列印常式
- JsonGeneratorExample : Json Generator - Json 生成常式
- JsonHttpClient : Json Http Client - Json HTTP Client常式(獲取網路Json數據並解析)
- JsonParserExample : Json Parser - Json 解析常式
- JsonServer : Json Server - Json Server常式(生成Json數據並發布)
- JsonUdpBeacon : Json Udp Beacon - Json UDP Beacon 常式

Extra Examples

-JsonHttpClientWithESP8266 : Json Http Client With ESP8266 - Json HTTP Client常式(獲取網路Json數據並解析)
-JsonServerWithESP8266 : Json Server With ESP8266 - Json Server常式(生成Json數據並發布)



Json Library Reference

- StaticJsonBuffer<200> jsonBuffer;

為JSON對象樹創建內存池(在棧上分配內存)

參數

200:內存大小(位元組) -根據對象大小更改

- DynamicJsonBuffer jsonBuffer;

為JSON對象樹創建內存池(在堆上分配內存)- 簡單但效率低




- JsonObject& root = jsonBuffer.createObject();

創建對象樹的根

- root["sensor"] = "gps";

在對象中添加值

參數

sensor:名稱
gps:值

- JsonArray& data = root.createNestedArray("data");

在對象中添加一個嵌套的數組

參數

data:數組名

- data.add(double_with_n_digits(48.756080, 6));

給data數組添加值

參數

48756080:值
6:保留小數位數

- root.printTo(Serial);

列印輸出

參數

48756080:值

例:{"sensor":"gps","time":1351824120,"data":[48.756080,2.302038]}


- root.prettyPrintTo(Serial);

列印輸出(格式)




- JsonObject& root = jsonBuffer.parseObject(json);

解析json數據

- sensor = root["sensor"]

取值

- latitude = root["data"][0]; "data":[48.756080,2.302038]

取值






返回Arduino庫菜單

返回首頁

更多建議和問題歡迎反饋至 YFRobot論壇