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
3a2797c2
Commit
3a2797c2
authored
Nov 07, 2014
by
funshine
Browse files
update readme
parent
bce59831
Changes
1
Show whitespace changes
Inline
Side-by-side
README.md
View file @
3a2797c2
# **nodeMcu API Instruction** #
# **nodeMcu API Instruction** #
###version 0.1 2014-10-11
###version 0.1 2014-10-11
###change log
:
###change log
:
2014-11-5
<br
/>
2014-11-5
<br
/>
delete log operation api from node module
<br
/>
delete log operation api from node module
<br
/>
...
@@ -70,10 +70,10 @@ module restart.
...
@@ -70,10 +70,10 @@ module restart.
node.restart()
node.restart()
####Parameters
####Parameters
n
ul
l
n
i
l
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
...
@@ -100,7 +100,7 @@ node.dsleep(us)<br />
...
@@ -100,7 +100,7 @@ node.dsleep(us)<br />
us:sleep time in micro second
us:sleep time in micro second
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
...
@@ -120,7 +120,7 @@ return chip identifier
...
@@ -120,7 +120,7 @@ return chip identifier
node.chipid()
node.chipid()
####Parameters
####Parameters
n
ul
l
n
i
l
####Returns
####Returns
number:chip identifier
number:chip identifier
...
@@ -128,7 +128,7 @@ number:chip identifier
...
@@ -128,7 +128,7 @@ number:chip identifier
####Example
####Example
```
```
uint32
id = node.chipid();
id = node.chipid();
```
```
####See also
####See also
...
@@ -143,7 +143,7 @@ return the available RAM size in bytes
...
@@ -143,7 +143,7 @@ return the available RAM size in bytes
node.heap()
node.heap()
####Parameters
####Parameters
n
ul
l
n
i
l
####Returns
####Returns
number:system heap size left in bytes
number:system heap size left in bytes
...
@@ -151,7 +151,7 @@ number:system heap size left in bytes
...
@@ -151,7 +151,7 @@ number:system heap size left in bytes
####Example
####Example
```
```
uint32
heap_size = node.heap();
heap_size = node.heap();
```
```
####See also
####See also
...
@@ -166,16 +166,16 @@ define button function.
...
@@ -166,16 +166,16 @@ define button function.
node.key(type, function())
node.key(type, function())
####Parameters
####Parameters
type: type is either string
”
long
”
or
”
short
”
. long: press the button for 3 seconds, short: press shortly(less than 3 seconds)
<br
/>
type: type is either string
"
long
"
or
"
short
"
. long: press the button for 3 seconds, short: press shortly(less than 3 seconds)
<br
/>
function(): user defined function for button. If n
ul
l, cancling the user defined function, function are initialized to default.
<br
/>
function(): user defined function for button. If n
i
l, cancling the user defined function, function are initialized to default.
<br
/>
Default function: long
:
change LED blinking rate, short
:
reset chip
Default function: long
:
change LED blinking rate, short
:
reset chip
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
```
```
node.key(long, function(){print('hello world')})
node.key(
"
long
"
, function(){print('hello world')})
```
```
####See also
####See also
...
@@ -187,20 +187,20 @@ null
...
@@ -187,20 +187,20 @@ null
setup the on/off time for led
setup the on/off time for led
####Syntax
####Syntax
node.
key(type, function()
)
node.
led(low, high
)
####Parameters
####Parameters
Low: LED off time, 0 for LED keeps on. Unit: milliseconds, time resolution: 80~100ms
<br
/>
Low: LED off time, 0 for LED keeps on. Unit: milliseconds, time resolution: 80~100ms
<br
/>
High: LED off time. Unit: milliseconds, time resolution: 80~100ms
High: LED off time. Unit: milliseconds, time resolution: 80~100ms
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
```
```
//turn led on forever.
//turn led on forever.
node.led(0
,null
);
node.led(0);
```
```
####See also
####See also
...
@@ -216,18 +216,18 @@ format flash for users.
...
@@ -216,18 +216,18 @@ format flash for users.
log.format()
log.format()
####Parameters
####Parameters
n
ul
l
n
i
l
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
```
```
//record log to init.lua. Call the file after system restart.
//record log to init.lua. Call the file after system restart.
log.format()
log.format()
log.start(
“
init.lua
”
, 1)
log.start(
"
init.lua
"
, 1)
print(
“
hello world
”
)
print(
"
hello world
"
)
log.stop()
log.stop()
```
```
...
@@ -249,17 +249,17 @@ filename: log file, directories are not supported<br />
...
@@ -249,17 +249,17 @@ filename: log file, directories are not supported<br />
noparse: 1 for lua VM doesn’t parse input, 0 for lua VM parse input
noparse: 1 for lua VM doesn’t parse input, 0 for lua VM parse input
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
```
```
//record log to init.lua. Call the file after system restart.
//record log to init.lua. Call the file after system restart.
log.format()
log.format()
log.start(
“
init.lua
”
, 1)
log.start(
"
init.lua
"
, 1)
print(
“
hello world
”
)
print(
"
hello world
"
)
log.stop()
log.stop()
//At this point, the content of init.lua is
“
print(
“
hello world
”)”
. When system restart, print(
“
hello world
”
) are excuted.
//At this point, the content of init.lua is
"
print(
"
hello world
")"
. When system restart, print(
"
hello world
"
) are excuted.
```
```
####See also
####See also
...
@@ -275,20 +275,20 @@ stop log.
...
@@ -275,20 +275,20 @@ stop log.
log.stop()
log.stop()
####Parameters
####Parameters
n
ul
l
n
i
l
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
```
```
//record log to init.lua. Call the file after system restart.
//record log to init.lua. Call the file after system restart.
log.format()
log.format()
log.start(
“
init.lua
”
, 1)
log.start(
"
init.lua
"
, 1)
print(
“
hello world
”
)
print(
"
hello world
"
)
log.stop()
log.stop()
//At this point, the content of init.lua is
“
print(
“
hello world
”)”
. When system restart, print(
“
hello world
”
) are excuted.
//At this point, the content of init.lua is
"
print(
"
hello world
")"
. When system restart, print(
"
hello world
"
) are excuted.
```
```
####See also
####See also
...
@@ -307,13 +307,13 @@ log.open(filename)
...
@@ -307,13 +307,13 @@ log.open(filename)
filename: log file, directories are not supported
filename: log file, directories are not supported
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
```
```
//print the first line of 'init.lua'
//print the first line of 'init.lua'
log.open(
“
init.lua
”
)
log.open(
"
init.lua
"
)
print(log.readline())
print(log.readline())
log.close()
log.close()
```
```
...
@@ -331,16 +331,16 @@ close the log file which opened before
...
@@ -331,16 +331,16 @@ close the log file which opened before
log.close()
log.close()
####Parameters
####Parameters
n
ul
l
n
i
l
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
```
```
//print the first line of 'init.lua'
//print the first line of 'init.lua'
log.open(
“
init.lua
”
)
log.open(
"
init.lua
"
)
print(log.readline())
print(log.readline())
log.close()
log.close()
```
```
...
@@ -358,16 +358,16 @@ read log file which is opened before line by line.
...
@@ -358,16 +358,16 @@ read log file which is opened before line by line.
log.readline()
log.readline()
####Parameters
####Parameters
n
ul
l
n
i
l
####Returns
####Returns
log file content in string
log file content in string
, line by line
####Example
####Example
```
```
//print the first line of 'init.lua'
//print the first line of 'init.lua'
log.open(
“
init.lua
”
)
log.open(
"
init.lua
"
)
print(log.readline())
print(log.readline())
log.close()
log.close()
```
```
...
@@ -385,15 +385,18 @@ list all files.
...
@@ -385,15 +385,18 @@ list all files.
log.list()
log.list()
####Parameters
####Parameters
n
ul
l
n
i
l
####Returns
####Returns
null
a lua table which contains the {file name: file size} pairs
####Example
####Example
```
```
log.list();
l = log.list();
for k,v in l do
print("name:"..k..", size:"..v)
end
```
```
####See also
####See also
...
@@ -406,7 +409,7 @@ wifi.STATION, wifi.SOFTAP, wifi.STATIONAP
...
@@ -406,7 +409,7 @@ wifi.STATION, wifi.SOFTAP, wifi.STATIONAP
<a
id=
"wf_setmode"
></a>
<a
id=
"wf_setmode"
></a>
## wifi.setmode(mode)
## wifi.setmode(mode)
####Description
####Description
set wifi
working
mode.
set wifi
operation
mode.
####Syntax
####Syntax
wifi.setmode(mode)
wifi.setmode(mode)
...
@@ -430,16 +433,16 @@ current mode after setup
...
@@ -430,16 +433,16 @@ current mode after setup
<a
id=
"wf_getmode"
></a>
<a
id=
"wf_getmode"
></a>
## wifi.getmode(mode)
## wifi.getmode(mode)
####Description
####Description
get wifi
working
mode.
get wifi
operation
mode.
####Syntax
####Syntax
wifi.getmode()
wifi.getmode()
####Parameters
####Parameters
n
ul
l
n
i
l
####Returns
####Returns
wifi
working
mode
wifi
operation
mode
####Example
####Example
...
@@ -461,11 +464,11 @@ wifi.startsmart(channel, function succeed_callback())
...
@@ -461,11 +464,11 @@ wifi.startsmart(channel, function succeed_callback())
####Parameters
####Parameters
channel: 1~13,startup channel for searching, if n
ul
l, default to 6. 20 seconds for each channel.
<br
/>
channel: 1~13,startup channel for searching, if n
i
l, default to 6. 20 seconds for each channel.
<br
/>
succeed_callback: callback function for success configuration, which is called after getting the password and the connection to AP.
succeed_callback: callback function for success configuration, which is called after getting the password and the connection to AP.
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
...
@@ -486,10 +489,10 @@ stop the configuring process.
...
@@ -486,10 +489,10 @@ stop the configuring process.
wifi.stopsmart()
wifi.stopsmart()
####Parameters
####Parameters
n
ul
l
n
i
l
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
...
@@ -517,7 +520,7 @@ ssid: string which is less than 32 bytes.<br />
...
@@ -517,7 +520,7 @@ ssid: string which is less than 32 bytes.<br />
password: string which is less than 64 bytes.
password: string which is less than 64 bytes.
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
...
@@ -539,11 +542,11 @@ connect to AP in station mode.
...
@@ -539,11 +542,11 @@ connect to AP in station mode.
wifi.sta.connect()
wifi.sta.connect()
####Parameters
####Parameters
n
ul
l
n
i
l
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
...
@@ -565,11 +568,11 @@ disconnect from AP in station mode.
...
@@ -565,11 +568,11 @@ disconnect from AP in station mode.
wifi.sta.disconnect()
wifi.sta.disconnect()
####Parameters
####Parameters
n
ul
l
n
i
l
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
...
@@ -591,11 +594,11 @@ auto connect to AP in station mode.
...
@@ -591,11 +594,11 @@ auto connect to AP in station mode.
wifi.sta.autoconnect(auto)
wifi.sta.autoconnect(auto)
####Parameters
####Parameters
auto: 0
for
disable auto connecting. 1
for
enable auto connecting
auto: 0
to
disable auto connecting. 1
to
enable auto connecting
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
...
@@ -618,7 +621,7 @@ get ip address in station mode.
...
@@ -618,7 +621,7 @@ get ip address in station mode.
wifi.sta.getip()
wifi.sta.getip()
####Parameters
####Parameters
n
ul
l
n
i
l
####Returns
####Returns
...
@@ -632,7 +635,7 @@ ip address in string, for example:"192.168.0.111"
...
@@ -632,7 +635,7 @@ ip address in string, for example:"192.168.0.111"
```
```
####See also
####See also
**-**
[
wifi.sta.
.
getmac()
](
#ws_getmac
)
**-**
[
wifi.sta.getmac()
](
#ws_getmac
)
<a
id=
"ws_getmac"
></a>
<a
id=
"ws_getmac"
></a>
...
@@ -644,7 +647,7 @@ get mac address in station mode.
...
@@ -644,7 +647,7 @@ get mac address in station mode.
wifi.sta.getmac()
wifi.sta.getmac()
####Parameters
####Parameters
n
ul
l
n
i
l
####Returns
####Returns
...
@@ -672,7 +675,7 @@ set ssid and password in ap mode.
...
@@ -672,7 +675,7 @@ set ssid and password in ap mode.
wifi.ap.config(cfg)
wifi.ap.config(cfg)
####Parameters
####Parameters
cfg: lua table
for
setup ap.
cfg: lua table
to
setup ap.
####Example:
####Example:
...
@@ -684,7 +687,7 @@ cfg: lua table for setup ap.
...
@@ -684,7 +687,7 @@ cfg: lua table for setup ap.
```
```
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
...
@@ -693,7 +696,7 @@ null
...
@@ -693,7 +696,7 @@ null
```
```
####See also
####See also
**-**
[]
<>
**-**
[]
(
)
<a
id=
"wa_getip"
></a>
<a
id=
"wa_getip"
></a>
## wifi.ap.getip()
## wifi.ap.getip()
...
@@ -704,7 +707,7 @@ get ip in ap mode.
...
@@ -704,7 +707,7 @@ get ip in ap mode.
wifi.ap.getip()
wifi.ap.getip()
####Parameters
####Parameters
n
ul
l
n
i
l
####Returns
####Returns
ip address in string, for example:"192.168.0.111"
ip address in string, for example:"192.168.0.111"
...
@@ -728,7 +731,7 @@ get mac address in ap mode.
...
@@ -728,7 +731,7 @@ get mac address in ap mode.
wifi.ap.getmac()
wifi.ap.getmac()
####Parameters
####Parameters
n
ul
l
n
i
l
####Returns
####Returns
mac address in string, for example:"1A-33-44-FE-55-BB"
mac address in string, for example:"1A-33-44-FE-55-BB"
...
@@ -756,7 +759,7 @@ tmr.dealy(us)
...
@@ -756,7 +759,7 @@ tmr.dealy(us)
us: delay time in micro second
us: delay time in micro second
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
...
@@ -778,7 +781,7 @@ return the current value of system counter: uint32, loopback, us.
...
@@ -778,7 +781,7 @@ return the current value of system counter: uint32, loopback, us.
tmr.now()
tmr.now()
####Parameters
####Parameters
n
ul
l
n
i
l
####Returns
####Returns
uint32: value of counter
uint32: value of counter
...
@@ -804,17 +807,17 @@ tmr.alarm(interval, repeat, function do())
...
@@ -804,17 +807,17 @@ tmr.alarm(interval, repeat, function do())
####Parameters
####Parameters
Interval: alarm time, unit: millisecond
<br
/>
Interval: alarm time, unit: millisecond
<br
/>
repeat: 0
for
one time alarm, 1
for
repeat
<br
/>
repeat: 0
-
one time alarm, 1
-
repeat
<br
/>
function do(): callback function for alarm timed out
function do(): callback function for alarm timed out
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
```
```
//print "hello world" every 1000ms
//print "hello world" every 1000ms
tmr.alarm(1000, 1, function() print(
“
hello world
”
) end )
tmr.alarm(1000, 1, function() print(
"
hello world
"
) end )
```
```
####See also
####See also
...
@@ -832,16 +835,16 @@ stop alarm.<br />
...
@@ -832,16 +835,16 @@ stop alarm.<br />
tmr.stop()
tmr.stop()
####Parameters
####Parameters
n
ul
l.
n
i
l.
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
```
```
//print "hello world" every 1000ms
//print "hello world" every 1000ms
tmr.alarm(1000, 1, function() print(
“
hello world
”
) end )
tmr.alarm(1000, 1, function() print(
"
hello world
"
) end )
//something else
//something else
...
@@ -871,7 +874,7 @@ pin: 0~11,IO index<br />
...
@@ -871,7 +874,7 @@ pin: 0~11,IO index<br />
mode: gpio.OUTPUT or gpio.INPUT, or gpio.INT(interrupt mode)
mode: gpio.OUTPUT or gpio.INPUT, or gpio.INT(interrupt mode)
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
...
@@ -897,7 +900,7 @@ gpio.read(pin)
...
@@ -897,7 +900,7 @@ gpio.read(pin)
pin: 0~11,IO index
pin: 0~11,IO index
####Returns
####Returns
number:0
for
low, 1
for
high
number:0
-
low, 1
-
high
####Example
####Example
...
@@ -923,7 +926,7 @@ pin: 0~11,IO index<br />
...
@@ -923,7 +926,7 @@ pin: 0~11,IO index<br />
level: gpio.HIGH or gpio.LOW
level: gpio.HIGH or gpio.LOW
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
...
@@ -949,11 +952,11 @@ gpio.trig(pin, type, function(level))
...
@@ -949,11 +952,11 @@ gpio.trig(pin, type, function(level))
####Parameters
####Parameters
pin: 0~11,IO index
<br
/>
pin: 0~11,IO index
<br
/>
type:
”
up
”
,
“
down
”
,
“
both
”
,
“
low
”
,
“
high
”
, which represent rising edge, falling edge, both edge, low level, high level trig mode separately.
<br
/>
type:
"
up
"
,
"
down
"
,
"
both
"
,
"
low
"
,
"
high
"
, which represent rising edge, falling edge, both edge, low level, high level trig mode separately.
<br
/>
function(level): callback function when triggered. The gpio level is the param. Use previous callback function if undefined here.
function(level): callback function when triggered. The gpio level is the param. Use previous callback function if undefined here.
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
...
@@ -992,7 +995,7 @@ clock: 1~500,pwm frequency<br />
...
@@ -992,7 +995,7 @@ clock: 1~500,pwm frequency<br />
duty: 0~100,pwm duty cycle in percentage
duty: 0~100,pwm duty cycle in percentage
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
...
@@ -1017,7 +1020,7 @@ pwm.close(pin)
...
@@ -1017,7 +1020,7 @@ pwm.close(pin)
pin: 0~11,IO index
pin: 0~11,IO index
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
...
@@ -1041,7 +1044,7 @@ pwm.start(pin)
...
@@ -1041,7 +1044,7 @@ pwm.start(pin)
pin: 0~11,IO index
pin: 0~11,IO index
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
...
@@ -1065,7 +1068,7 @@ pwm.stop(pin)
...
@@ -1065,7 +1068,7 @@ pwm.stop(pin)
pin: 0~11,IO index
pin: 0~11,IO index
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
...
@@ -1092,7 +1095,7 @@ pin: 0~11,IO index.<br />
...
@@ -1092,7 +1095,7 @@ pin: 0~11,IO index.<br />
clock: 1~500, pwm frequency.
clock: 1~500, pwm frequency.
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
...
@@ -1141,7 +1144,7 @@ pin: 0~11,IO index<br />
...
@@ -1141,7 +1144,7 @@ pin: 0~11,IO index<br />
duty: 0~100,pwm duty cycle in percentage
duty: 0~100,pwm duty cycle in percentage
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
...
@@ -1165,7 +1168,7 @@ pwm.getduty(pin)
...
@@ -1165,7 +1168,7 @@ pwm.getduty(pin)
pin: 0~11,IO index
pin: 0~11,IO index
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
...
@@ -1262,7 +1265,7 @@ ip:ip address string, can be omitted<br />
...
@@ -1262,7 +1265,7 @@ ip:ip address string, can be omitted<br />
function(net.socket): callback function, pass to Caller function as param if a connection is created successfully
function(net.socket): callback function, pass to Caller function as param if a connection is created successfully
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
...
@@ -1289,10 +1292,10 @@ close server.
...
@@ -1289,10 +1292,10 @@ close server.
net.server.close()
net.server.close()
####Parameters
####Parameters
n
ul
l
n
i
l
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
...
@@ -1321,7 +1324,7 @@ port: port number<br />
...
@@ -1321,7 +1324,7 @@ port: port number<br />
ip: ip address in string
ip: ip address in string
####Returns
####Returns
n
ul
l
n
i
l
####See also
####See also
**-**
[
net.socket:on()
](
#nk_on
)
**-**
[
net.socket:on()
](
#nk_on
)
...
@@ -1340,7 +1343,7 @@ string: data in string which will be sent to remote<br />
...
@@ -1340,7 +1343,7 @@ string: data in string which will be sent to remote<br />
function(sent): callback function for sending string
function(sent): callback function for sending string
####Returns
####Returns
n
ul
l
n
i
l
####See also
####See also
**-**
[
net.socket:on()
](
#nk_on
)
**-**
[
net.socket:on()
](
#nk_on
)
...
@@ -1357,10 +1360,10 @@ on(event, function cb())
...
@@ -1357,10 +1360,10 @@ on(event, function cb())
####Parameters
####Parameters
event: string, which can be: "connection","reconnection","disconnection","receive","sent"
<br
/>
event: string, which can be: "connection","reconnection","disconnection","receive","sent"
<br
/>
function cb(net.socket, [string]): callback function. The first param is the socket.
<br
/>
function cb(net.socket, [string]): callback function. The first param is the socket.
<br
/>
If event is
”
receive
”
, the second param is received data in string.
If event is
"
receive
"
, the second param is received data in string.
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
...
@@ -1384,10 +1387,10 @@ close socket.
...
@@ -1384,10 +1387,10 @@ close socket.
close()
close()
####Parameters
####Parameters
n
ul
l
n
i
l
####Returns
####Returns
n
ul
l
n
i
l
####See also
####See also
**-**
[
net.createServer()
](
#nt_createServer
)
**-**
[
net.createServer()
](
#nt_createServer
)
...
@@ -1406,7 +1409,7 @@ domain: domain name.<br />
...
@@ -1406,7 +1409,7 @@ domain: domain name.<br />
function (net.socket, ip): callback function. The first param is the socket, the second param is the ip address in string.
function (net.socket, ip): callback function. The first param is the socket, the second param is the ip address in string.
####Returns
####Returns
n
ul
l
n
i
l
####See also
####See also
**-**
[
net.createServer()
](
#nt_createServer
)
**-**
[
net.createServer()
](
#nt_createServer
)
...
@@ -1431,7 +1434,7 @@ pinSCL: 0~11,IO index<br />
...
@@ -1431,7 +1434,7 @@ pinSCL: 0~11,IO index<br />
speed: i2c.SLOW
speed: i2c.SLOW
####Returns
####Returns
n
ul
l
n
i
l
####See also
####See also
**-**
[
i2c.read()
](
#ic_read
)
**-**
[
i2c.read()
](
#ic_read
)
...
@@ -1449,7 +1452,7 @@ i2c.start(id)
...
@@ -1449,7 +1452,7 @@ i2c.start(id)
id = 0
id = 0
####Returns
####Returns
n
ul
l
n
i
l
####See also
####See also
**-**
[
i2c.read()
](
#ic_read
)
**-**
[
i2c.read()
](
#ic_read
)
...
@@ -1467,7 +1470,7 @@ i2c.stop(id)
...
@@ -1467,7 +1470,7 @@ i2c.stop(id)
id = 0
id = 0
####Returns
####Returns
n
ul
l
n
i
l
####See also
####See also
**-**
[
i2c.read()
](
#ic_read
)
**-**
[
i2c.read()
](
#ic_read
)
...
@@ -1487,7 +1490,7 @@ device_addr: device address.<br />
...
@@ -1487,7 +1490,7 @@ device_addr: device address.<br />
direction: i2c.TRANSMITTER for writing mode , i2c. RECEIVER for reading mode
direction: i2c.TRANSMITTER for writing mode , i2c. RECEIVER for reading mode
####Returns
####Returns
n
ul
l
n
i
l
####See also
####See also
**-**
[
i2c.read()
](
#ic_read
)
**-**
[
i2c.read()
](
#ic_read
)
...
@@ -1505,7 +1508,7 @@ id=0<br />
...
@@ -1505,7 +1508,7 @@ id=0<br />
data: data can be numbers, string or lua table.
data: data can be numbers, string or lua table.
####Returns
####Returns
n
ul
l
n
i
l
####Example
####Example
...
...
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