Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
effb5724
Commit
effb5724
authored
Apr 22, 2015
by
Martin Han
Browse files
Add Example to yeelink lib
parent
a60f28cf
Changes
1
Show whitespace changes
Inline
Side-by-side
lua_modules/yeelink/Example_for_Yeelink_Lib.lua
0 → 100644
View file @
effb5724
-- ***************************************************************************
-- Example for Yeelink Lib
--
-- Written by Martin
--
--
-- MIT license, http://opensource.org/licenses/MIT
-- ***************************************************************************
wifi
.
setmode
(
wifi
.
STATION
)
--Step1: Connect to Wifi
wifi
.
sta
.
config
(
"SSID"
,
"Password"
)
dht
=
require
(
"dht_lib"
)
--Step2: "Require" the libs
yeelink
=
require
(
"yeelink_lib"
)
yeelink
.
init
(
23333
,
23333
,
"You api-key"
,
function
()
--Step3: Register the callback function
print
(
"Yeelink Init OK..."
)
tmr
.
alarm
(
1
,
60000
,
1
,
function
()
--Step4: Have fun~ (Update your data)
dht
.
read
(
4
)
yeelink
.
update
(
dht
.
getTemperature
())
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