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
67ab2d01
Commit
67ab2d01
authored
Feb 21, 2015
by
Tamas Szabo
Browse files
Update ds18b20.lua
parent
5a629e42
Changes
1
Hide whitespace changes
Inline
Side-by-side
lua_modules/ds18b20/ds18b20.lua
View file @
67ab2d01
...
@@ -99,7 +99,7 @@ function readNumber(addr, unit)
...
@@ -99,7 +99,7 @@ function readNumber(addr, unit)
if
(
crc
==
data
:
byte
(
9
))
then
if
(
crc
==
data
:
byte
(
9
))
then
t
=
(
data
:
byte
(
1
)
+
data
:
byte
(
2
)
*
256
)
t
=
(
data
:
byte
(
1
)
+
data
:
byte
(
2
)
*
256
)
if
(
t
>
32767
)
then
if
(
t
>
32767
)
then
t
=
-
(
65536
-
t
)
t
=
t
-
65536
end
end
if
(
unit
==
nil
or
unit
==
C
)
then
if
(
unit
==
nil
or
unit
==
C
)
then
t
=
t
*
625
t
=
t
*
625
...
...
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