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
94aa3bef
Commit
94aa3bef
authored
Feb 17, 2015
by
Vowstar
Browse files
Merge pull request #227 from robcazzaro/patch-1
Update dht22.lua to address issue #225
parents
7e524f7d
85727485
Changes
1
Hide whitespace changes
Inline
Side-by-side
lua_modules/dht22/dht22.lua
View file @
94aa3bef
...
...
@@ -62,17 +62,17 @@ function M.read(pin)
--DHT data acquired, process.
for
i
=
1
,
16
,
1
do
if
(
bitStream
[
i
]
>
4
)
then
if
(
bitStream
[
i
]
>
3
)
then
humidity
=
humidity
+
2
^
(
16
-
i
)
end
end
for
i
=
1
,
16
,
1
do
if
(
bitStream
[
i
+
16
]
>
4
)
then
if
(
bitStream
[
i
+
16
]
>
3
)
then
temperature
=
temperature
+
2
^
(
16
-
i
)
end
end
for
i
=
1
,
8
,
1
do
if
(
bitStream
[
i
+
32
]
>
4
)
then
if
(
bitStream
[
i
+
32
]
>
3
)
then
checksum
=
checksum
+
2
^
(
8
-
i
)
end
end
...
...
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