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
0b8b883e
Commit
0b8b883e
authored
Jan 21, 2015
by
Javier Yáñez
Browse files
README.md for DHT22 module
parent
b6a40301
Changes
1
Hide whitespace changes
Inline
Side-by-side
lua_modules/dht22/README.md
0 → 100644
View file @
0b8b883e
# DHT22 module
## Example
```
lua
PIN
=
4
-- data pin, GPIO2
dht22
=
require
(
"dht22"
)
dht22
.
read
(
PIN
)
t
=
dht22
.
getTemperature
()
h
=
dht22
.
getHumidity
()
-- temperature in degrees Celsius and Farenheit
print
(
"Temperature: "
..
(
t
/
10
)
..
"."
..
(
t
%
10
)
..
" deg C"
)
print
(
"Temperature: "
..
(
9
*
t
/
50
+
32
)
..
"."
..
(
9
*
t
/
5
%
10
)
..
" deg F"
)
-- humidity
print
(
"Humidity: "
..
(
h
/
10
)
..
"."
..
(
h
%
10
)
..
"%"
)
-- release module
dht22
=
nil
package.loaded
[
"dht22"
]
=
nil
```
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