Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
bce686a8
Commit
bce686a8
authored
Dec 07, 2014
by
HuangRui
Browse files
* Changed the temperature output format, add MIT licence.
parent
8f1516ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
examples/ds18b20.lua
View file @
bce686a8
-- 18b20 Example
--[[
-- 18b20 one wire example for NODEMCU
-- NODEMCU TEAM
-- LICENCE: http://opensource.org/licenses/MIT
-- Vowstar <vowstar@nodemcu.com>
--]]
pin
=
9
pin
=
9
ow
.
setup
(
pin
)
ow
.
setup
(
pin
)
count
=
0
count
=
0
...
@@ -37,7 +43,7 @@ else
...
@@ -37,7 +43,7 @@ else
t
=
(
data
:
byte
(
1
)
+
data
:
byte
(
2
)
*
256
)
*
625
t
=
(
data
:
byte
(
1
)
+
data
:
byte
(
2
)
*
256
)
*
625
t1
=
t
/
10000
t1
=
t
/
10000
t2
=
t
%
10000
t2
=
t
%
10000
print
(
"Temperature="
..
t1
..
"."
..
t2
..
"Centigrade"
)
print
(
"Temperature=
"
..
t1
..
"."
..
t2
..
"
Centigrade"
)
end
end
tmr
.
wdclr
()
tmr
.
wdclr
()
until
false
until
false
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment