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
6f9c17a2
Commit
6f9c17a2
authored
Nov 19, 2014
by
funshine
Browse files
add adc module, wifi.sta.getap() api, update doc
parent
c49d438c
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
0.9.2/512k-flash/nodemcu_512k.bin
View file @
6f9c17a2
No preview for this file type
README.html
View file @
6f9c17a2
This diff is collapsed.
Click to expand it.
README.md
View file @
6f9c17a2
# **NodeMcu** #
# **NodeMcu** #
###A lua based firmware for wifi-soc esp8266
###A lua based firmware for wifi-soc esp8266
version 0.9.2 build 2014-11-1
8
version 0.9.2 build 2014-11-1
9
# Change log
# Change log
[
change log
](
https://github.com/funshine/nodemcu-firmware/wiki/nodemcu_api_en#change_log
)
<br
/>
[
change log
](
https://github.com/funshine/nodemcu-firmware/wiki/nodemcu_api_en#change_log
)
<br
/>
[
变更日志
](
https://github.com/funshine/nodemcu-firmware/wiki/nodemcu_api_cn#change_log
)
[
变更日志
](
https://github.com/funshine/nodemcu-firmware/wiki/nodemcu_api_cn#change_log
)
...
...
nodemcu_api_cn.html
View file @
6f9c17a2
This diff is collapsed.
Click to expand it.
nodemcu_api_cn.md
View file @
6f9c17a2
# **nodeMcu API说明** #
# **nodeMcu API说明** #
[
English Version
](
https://github.com/funshine/nodemcu-firmware/wiki/nodemcu_api_en
)
[
English Version
](
https://github.com/funshine/nodemcu-firmware/wiki/nodemcu_api_en
)
###版本 0.9.2 build 2014-11-1
8
###版本 0.9.2 build 2014-11-1
9
<a
id=
"change_log"
></a>
<a
id=
"change_log"
></a>
###变更日志:
###变更日志:
2014-11-19
<br
/>
增加adc模块,adc.read(0)读取adc的值。
<br
/>
wifi模块增加wifi.sta.getap() 函数,用于获取ap列表。
2014-11-18
<br
/>
2014-11-18
<br
/>
修正tcp服务器不能使用:close()函数关闭tcp连接的问题。
<br
/>
修正tcp服务器不能使用:close()函数关闭tcp连接的问题。
<br
/>
tcp服务器: 服务器将关闭30s内未使用的闲置的连接。(修正前为180s)
<br
/>
tcp服务器: 服务器将关闭30s内未使用的闲置的连接。(修正前为180s)
<br
/>
...
@@ -807,6 +811,36 @@ mac地址字符串,如:"18-33-44-FE-55-BB"
...
@@ -807,6 +811,36 @@ mac地址字符串,如:"18-33-44-FE-55-BB"
####参见
####参见
**-**
[
wifi.sta.getip()
](
#ws_getip
)
**-**
[
wifi.sta.getip()
](
#ws_getip
)
<a
id=
"ws_getap"
></a>
## wifi.sta.getap()
####描述
扫描并列出ap,结果以一个lua table为参数传递给回调函数。
####语法
wifi.sta.getap(function(table))
####参数
function(table): 当扫描结束时,调用此回调函数
<br
/>
扫描结果是一个lua table,key为ap的ssid,value为其他信息,格式:authmode,rssi,bssid,channel
####返回值
nil
####示例
```
lua
-- print ap list
function
listap
(
t
)
for
k
,
v
in
pairs
(
t
)
do
print
(
k
..
" : "
..
v
)
end
end
wifi
.
sta
.
getap
(
listap
)
```
####参见
**-**
[
wifi.sta.getip()
](
#ws_getip
)
#wifi.ap 子模块
#wifi.ap 子模块
...
@@ -1707,4 +1741,25 @@ string:接收到的数据。
...
@@ -1707,4 +1741,25 @@ string:接收到的数据。
```
```
####参见
####参见
**-**
[
i2c.write()
](
#ic_write
)
**-**
[
i2c.write()
](
#ic_write
)
\ No newline at end of file
#adc 模块
##常量
无
<a
id=
"adc_read"
></a>
## adc.read()
####描述
读取adc的值,esp8266只有一个10bit adc,id为0,最大值1024
####语法
adc.read(id)
####参数
id = 0
<br
/>
####返回值
adc 值 10bit,最大1024.
####参见
**-**
[](
)
nodemcu_api_en.html
View file @
6f9c17a2
This diff is collapsed.
Click to expand it.
nodemcu_api_en.md
View file @
6f9c17a2
# **nodeMcu API Instruction** #
# **nodeMcu API Instruction** #
[
中文版本
](
https://github.com/funshine/nodemcu-firmware/wiki/nodemcu_api_cn
)
[
中文版本
](
https://github.com/funshine/nodemcu-firmware/wiki/nodemcu_api_cn
)
###version 0.9.2 build 2014-11-1
8
###version 0.9.2 build 2014-11-1
9
<a
id=
"change_log"
></a>
<a
id=
"change_log"
></a>
###change log:
###change log:
2014-11-19
<br
/>
add adc module, use adc.read(0) to read adc value, no tests made.
<br
/>
add wifi.sta.getap() api to wifi.sta module, to get ap list.
2014-11-18
<br
/>
2014-11-18
<br
/>
bug fixed: net.socket:connect() has no effect.
bug fixed: net.socket:connect() has no effect.
...
@@ -824,6 +828,36 @@ mac address in string, for example:"18-33-44-FE-55-BB"
...
@@ -824,6 +828,36 @@ mac address in string, for example:"18-33-44-FE-55-BB"
####See also
####See also
**-**
[
wifi.sta.getip()
](
#ws_getip
)
**-**
[
wifi.sta.getip()
](
#ws_getip
)
<a
id=
"ws_getap"
></a>
## wifi.sta.getap()
####Description
scan and get ap list as a lua table into callback function.
####Syntax
wifi.sta.getap(function(table))
####Parameters
function(table): a callback function to receive ap table when scan is done
<br
/>
this function receive a table, the key is the ssid, value is other info in format: authmode,rssi,bssid,channel
####Returns
nil
####Example
```
lua
-- print ap list
function
listap
(
t
)
for
k
,
v
in
pairs
(
t
)
do
print
(
k
..
" : "
..
v
)
end
end
wifi
.
sta
.
getap
(
listap
)
```
####See also
**-**
[
wifi.sta.getip()
](
#ws_getip
)
#wifi.ap module
#wifi.ap module
...
@@ -1728,3 +1762,23 @@ string:data received.
...
@@ -1728,3 +1762,23 @@ string:data received.
####See also
####See also
**-**
[
i2c.write()
](
#ic_write
)
**-**
[
i2c.write()
](
#ic_write
)
#adc module
##CONSTANT
none
<a
id=
"adc_read"
></a>
## adc.read()
####Description
read adc value of id, esp8266 has only one 10bit adc, id=0
####Syntax
adc.read(id)
####Parameters
id = 0
<br
/>
####Returns
adc value
####See also
**-**
[](
)
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