From ebcc9c1b3c4acbebebbd1ff4c70a8a2885ab7687 Mon Sep 17 00:00:00 2001 From: HuangRui Date: Tue, 9 Dec 2014 14:19:11 +0800 Subject: [PATCH 1/2] * Changed ds18b20 wiki --- modules/ds18b20.CN.md | 22 ++++++++++++++++++++-- modules/ds18b20.EN.md | 17 ++++++++++++++++- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/modules/ds18b20.CN.md b/modules/ds18b20.CN.md index 0ad302a3..79c53f54 100644 --- a/modules/ds18b20.CN.md +++ b/modules/ds18b20.CN.md @@ -3,13 +3,17 @@ ds18b20 = require("ds18b20") +#释放 +ds18b20 = nil +package.loaded["ds18b20"]=nil + ##常量 C, F, K ##setup() ####描述 -设置DS18B20所在的Pin。
+设置DS18B20所在的管脚(pin)。
####语法 setup(pin) @@ -24,6 +28,10 @@ nil ```lua ds18b20 = require("ds18b20") ds18b20.setup(9) +-- Don't forget release it after use +ds18b20 = nil +package.loaded["ds18b20"]=nil + ``` ####参见 @@ -51,6 +59,10 @@ addrs = ds18b20.addrs() if (addrs ~= nil) then print("Total DS18B20 sensors: "..table.getn(addrs)) end +-- Don't forget release it after use +ds18b20 = nil +package.loaded["ds18b20"]=nil + ``` ####参见 @@ -94,6 +106,10 @@ print(t.readNumber()) print(t.readNumber(nil,t.F)) -- Read as values t1, t2 = t.readNumber() +-- Don't forget release it after use +t = nil +package.loaded["ds18b20"]=nil + ``` ####参见 **-** []() @@ -132,7 +148,9 @@ print(t.read(addrs[2],t.K)) print(t.read()) -- Just read as centigrade print(t.read(nil,t.C)) - +-- Don't forget release it after use +t = nil +package.loaded["ds18b20"]=nil ``` ####参见 **-** []() diff --git a/modules/ds18b20.EN.md b/modules/ds18b20.EN.md index a1b72ca5..e7c216ef 100644 --- a/modules/ds18b20.EN.md +++ b/modules/ds18b20.EN.md @@ -3,6 +3,10 @@ ds18b20 = require("ds18b20") +## Release +ds18b20 = nil +package.loaded["ds18b20"]=nil + ##Constant C, F, K @@ -24,6 +28,9 @@ nil ```lua ds18b20 = require("ds18b20") ds18b20.setup(9) +-- Don't forget release it after use +ds18b20 = nil +package.loaded["ds18b20"]=nil ``` ####See also @@ -51,6 +58,9 @@ addrs = ds18b20.addrs() if (addrs ~= nil) then print("Total DS18B20 sensors: "..table.getn(addrs)) end +-- Don't forget release it after use +ds18b20 = nil +package.loaded["ds18b20"]=nil ``` ####See also @@ -94,6 +104,9 @@ print(t.readNumber()) print(t.readNumber(nil,t.F)) -- Read as values t1, t2 = t.readNumber() +-- Don't forget release it after use +t = nil +package.loaded["ds18b20"]=nil ``` ####See also **-** []() @@ -132,7 +145,9 @@ print(t.read(addrs[2],t.K)) print(t.read()) -- Just read as centigrade print(t.read(nil,t.C)) - +-- Don't forget release it after use +t = nil +package.loaded["ds18b20"]=nil ``` ####See also **-** []() From 069d7bf850643e6bca43dc28beec9f9413eb8bbc Mon Sep 17 00:00:00 2001 From: HuangRui Date: Tue, 9 Dec 2014 14:21:46 +0800 Subject: [PATCH 2/2] * Fixed the format of ds18b20 wiki --- modules/ds18b20.CN.md | 7 ++++--- modules/ds18b20.EN.md | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/ds18b20.CN.md b/modules/ds18b20.CN.md index 79c53f54..c2543fed 100644 --- a/modules/ds18b20.CN.md +++ b/modules/ds18b20.CN.md @@ -1,12 +1,13 @@ #DS18B20 模块 ##引用 - +```lua ds18b20 = require("ds18b20") - +``` #释放 +```lua ds18b20 = nil package.loaded["ds18b20"]=nil - +``` ##常量 C, F, K diff --git a/modules/ds18b20.EN.md b/modules/ds18b20.EN.md index e7c216ef..74cdcac4 100644 --- a/modules/ds18b20.EN.md +++ b/modules/ds18b20.EN.md @@ -1,12 +1,13 @@ #DS18B20 Module ##Require - +```lua ds18b20 = require("ds18b20") - +``` ## Release +```lua ds18b20 = nil package.loaded["ds18b20"]=nil - +``` ##Constant C, F, K