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
d07aa63e
Commit
d07aa63e
authored
Dec 07, 2014
by
funshine
Browse files
add 1-wire module, change net.socket.send() payload to max 1460
parent
ab850628
Changes
3
Hide whitespace changes
Inline
Side-by-side
0.9.2/512k-flash/nodemcu_512k.bin
View file @
d07aa63e
No preview for this file type
README.md
View file @
d07aa63e
# **NodeMcu** #
# **NodeMcu** #
###A lua based firmware for wifi-soc esp8266
###A lua based firmware for wifi-soc esp8266
version 0.9.2 build 2014-12-0
4
version 0.9.2 build 2014-12-0
7
# Change log
# Change log
2014-12-04
<br
/>
2014-12-07
<br
/>
fix memory leak issue when input and run from console.
add ow(1-wire module), from arduino, and use same api.
<br
/>
add an 18b20 1-wire example.
<br
/>
change net.socket.send() payload max len from 256 to 1460.
[
more change log
](
https://github.com/nodemcu/nodemcu-firmware/wiki/nodemcu_api_en#change_log
)
<br
/>
[
more change log
](
https://github.com/nodemcu/nodemcu-firmware/wiki/nodemcu_api_en#change_log
)
<br
/>
[
更多变更日志
](
https://github.com/nodemcu/nodemcu-firmware/wiki/nodemcu_api_cn#change_log
)
[
更多变更日志
](
https://github.com/nodemcu/nodemcu-firmware/wiki/nodemcu_api_cn#change_log
)
...
@@ -11,7 +13,7 @@ fix memory leak issue when input and run from console.
...
@@ -11,7 +13,7 @@ fix memory leak issue when input and run from console.
-
Easy to access wireless router
-
Easy to access wireless router
-
Based on Lua 5.1.4
-
Based on Lua 5.1.4
-
Event-Drive programming preferred.
-
Event-Drive programming preferred.
-
Build-in file, timer, pwm, i2c, net, gpio, wifi, adc, uart and system api.
-
Build-in file, timer, pwm, i2c,
1-wire,
net, gpio, wifi, adc, uart and system api.
-
GPIO pin re-mapped, use the index to access gpio, i2c, pwm.
-
GPIO pin re-mapped, use the index to access gpio, i2c, pwm.
-
GPIO Map Table:
-
GPIO Map Table:
...
...
examples/ds18b20.lua
0 → 100644
View file @
d07aa63e
-- 18b20 Example
pin
=
9
ow
.
setup
(
pin
)
count
=
0
repeat
count
=
count
+
1
addr
=
ow
.
reset_search
(
pin
)
addr
=
ow
.
search
(
pin
)
tmr
.
wdclr
()
until
((
addr
~=
nil
)
or
(
count
>
100
))
if
(
addr
==
nil
)
then
print
(
"No more addresses."
)
else
print
(
addr
:
byte
(
1
,
8
))
crc
=
ow
.
crc8
(
string.sub
(
addr
,
1
,
7
))
if
(
crc
==
addr
:
byte
(
8
))
then
if
((
addr
:
byte
(
1
)
==
0x10
)
or
(
addr
:
byte
(
1
)
==
0x28
))
then
print
(
"Device is a DS18S20 family device."
)
repeat
ow
.
reset
(
pin
)
ow
.
select
(
pin
,
addr
)
ow
.
write
(
pin
,
0x44
,
1
)
tmr
.
delay
(
1000000
)
present
=
ow
.
reset
(
pin
)
ow
.
select
(
pin
,
addr
)
ow
.
write
(
pin
,
0xBE
,
1
)
print
(
"P="
..
present
)
data
=
nil
data
=
string.char
(
ow
.
read
(
pin
))
for
i
=
1
,
8
do
data
=
data
..
string.char
(
ow
.
read
(
pin
))
end
print
(
data
:
byte
(
1
,
9
))
crc
=
ow
.
crc8
(
string.sub
(
data
,
1
,
8
))
print
(
"CRC="
..
crc
)
if
(
crc
==
data
:
byte
(
9
))
then
t
=
(
data
:
byte
(
1
)
+
data
:
byte
(
2
)
*
256
)
*
625
t1
=
t
/
10000
t2
=
t
%
10000
print
(
"Temperature="
..
t1
..
"."
..
t2
..
"Centigrade"
)
end
tmr
.
wdclr
()
until
false
else
print
(
"Device family is not recognized."
)
end
else
print
(
"CRC is not valid!"
)
end
end
\ No newline at end of file
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