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
c3680f82
Commit
c3680f82
authored
Oct 11, 2015
by
devsaurus
Browse files
update examples and doc to api change
parent
28a04cc9
Changes
7
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
c3680f82
...
@@ -405,7 +405,7 @@ All other pins can be assigned to any available GPIO:
...
@@ -405,7 +405,7 @@ All other pins can be assigned to any available GPIO:
Also refer to the initialization sequence eg in
[
u8g_graphics_test.lua
](
lua_examples/u8glib/u8g_graphics_test.lua
)
:
Also refer to the initialization sequence eg in
[
u8g_graphics_test.lua
](
lua_examples/u8glib/u8g_graphics_test.lua
)
:
```
lua
```
lua
spi
.
setup
(
1
,
spi
.
MASTER
,
spi
.
CPOL_LOW
,
spi
.
CPHA_LOW
,
spi
.
DATABITS_8
,
8
)
spi
.
setup
(
1
,
spi
.
MASTER
,
spi
.
CPOL_LOW
,
spi
.
CPHA_LOW
,
8
)
```
```
...
@@ -488,7 +488,7 @@ All other pins can be assigned to any available GPIO:
...
@@ -488,7 +488,7 @@ All other pins can be assigned to any available GPIO:
Also refer to the initialization sequence eg in
[
GraphicsTest.lua
](
lua_examples/ucglib/GraphicsRest.lua
)
:
Also refer to the initialization sequence eg in
[
GraphicsTest.lua
](
lua_examples/ucglib/GraphicsRest.lua
)
:
```
lua
```
lua
spi
.
setup
(
1
,
spi
.
MASTER
,
spi
.
CPOL_LOW
,
spi
.
CPHA_LOW
,
spi
.
DATABITS_8
,
8
)
spi
.
setup
(
1
,
spi
.
MASTER
,
spi
.
CPOL_LOW
,
spi
.
CPHA_LOW
,
8
)
```
```
#####Library usage
#####Library usage
...
...
lua_examples/u8glib/u8g_bitmaps.lua
View file @
c3680f82
...
@@ -30,7 +30,7 @@ function init_spi_display()
...
@@ -30,7 +30,7 @@ function init_spi_display()
local
dc
=
4
-- GPIO2
local
dc
=
4
-- GPIO2
local
res
=
0
-- GPIO16
local
res
=
0
-- GPIO16
spi
.
setup
(
1
,
spi
.
MASTER
,
spi
.
CPOL_LOW
,
spi
.
CPHA_LOW
,
spi
.
DATABITS_8
,
8
)
spi
.
setup
(
1
,
spi
.
MASTER
,
spi
.
CPOL_LOW
,
spi
.
CPHA_LOW
,
8
)
disp
=
u8g
.
ssd1306_128x64_hw_spi
(
cs
,
dc
,
res
)
disp
=
u8g
.
ssd1306_128x64_hw_spi
(
cs
,
dc
,
res
)
end
end
...
...
lua_examples/u8glib/u8g_graphics_test.lua
View file @
c3680f82
...
@@ -29,7 +29,7 @@ function init_spi_display()
...
@@ -29,7 +29,7 @@ function init_spi_display()
local
dc
=
4
-- GPIO2
local
dc
=
4
-- GPIO2
local
res
=
0
-- GPIO16
local
res
=
0
-- GPIO16
spi
.
setup
(
1
,
spi
.
MASTER
,
spi
.
CPOL_LOW
,
spi
.
CPHA_LOW
,
spi
.
DATABITS_8
,
8
)
spi
.
setup
(
1
,
spi
.
MASTER
,
spi
.
CPOL_LOW
,
spi
.
CPHA_LOW
,
8
)
disp
=
u8g
.
ssd1306_128x64_hw_spi
(
cs
,
dc
,
res
)
disp
=
u8g
.
ssd1306_128x64_hw_spi
(
cs
,
dc
,
res
)
end
end
...
...
lua_examples/u8glib/u8g_rotation.lua
View file @
c3680f82
...
@@ -30,7 +30,7 @@ function init_spi_display()
...
@@ -30,7 +30,7 @@ function init_spi_display()
local
dc
=
4
-- GPIO2
local
dc
=
4
-- GPIO2
local
res
=
0
-- GPIO16
local
res
=
0
-- GPIO16
spi
.
setup
(
1
,
spi
.
MASTER
,
spi
.
CPOL_LOW
,
spi
.
CPHA_LOW
,
spi
.
DATABITS_8
,
8
)
spi
.
setup
(
1
,
spi
.
MASTER
,
spi
.
CPOL_LOW
,
spi
.
CPHA_LOW
,
8
)
disp
=
u8g
.
ssd1306_128x64_hw_spi
(
cs
,
dc
,
res
)
disp
=
u8g
.
ssd1306_128x64_hw_spi
(
cs
,
dc
,
res
)
end
end
...
...
lua_examples/ucglib/GraphicsTest.lua
View file @
c3680f82
...
@@ -8,7 +8,7 @@ function init_spi_display()
...
@@ -8,7 +8,7 @@ function init_spi_display()
local
dc
=
4
-- GPIO2
local
dc
=
4
-- GPIO2
local
res
=
0
-- GPIO16
local
res
=
0
-- GPIO16
spi
.
setup
(
1
,
spi
.
MASTER
,
spi
.
CPOL_LOW
,
spi
.
CPHA_LOW
,
spi
.
DATABITS_8
,
8
)
spi
.
setup
(
1
,
spi
.
MASTER
,
spi
.
CPOL_LOW
,
spi
.
CPHA_LOW
,
8
)
-- initialize the matching driver for your display
-- initialize the matching driver for your display
-- see app/include/ucg_config.h
-- see app/include/ucg_config.h
...
...
lua_examples/ucglib/HelloWorld.lua
View file @
c3680f82
...
@@ -8,7 +8,7 @@ function init_spi_display()
...
@@ -8,7 +8,7 @@ function init_spi_display()
local
dc
=
4
-- GPIO2
local
dc
=
4
-- GPIO2
local
res
=
0
-- GPIO16
local
res
=
0
-- GPIO16
spi
.
setup
(
1
,
spi
.
MASTER
,
spi
.
CPOL_LOW
,
spi
.
CPHA_LOW
,
spi
.
DATABITS_8
,
8
)
spi
.
setup
(
1
,
spi
.
MASTER
,
spi
.
CPOL_LOW
,
spi
.
CPHA_LOW
,
8
)
disp
=
ucg
.
ili9341_18x240x320_hw_spi
(
cs
,
dc
,
res
)
disp
=
ucg
.
ili9341_18x240x320_hw_spi
(
cs
,
dc
,
res
)
end
end
...
...
lua_examples/ucglib/UcgLogo.lua
View file @
c3680f82
...
@@ -8,7 +8,7 @@ function init_spi_display()
...
@@ -8,7 +8,7 @@ function init_spi_display()
local
dc
=
4
-- GPIO2
local
dc
=
4
-- GPIO2
local
res
=
0
-- GPIO16
local
res
=
0
-- GPIO16
spi
.
setup
(
1
,
spi
.
MASTER
,
spi
.
CPOL_LOW
,
spi
.
CPHA_LOW
,
spi
.
DATABITS_8
,
8
)
spi
.
setup
(
1
,
spi
.
MASTER
,
spi
.
CPOL_LOW
,
spi
.
CPHA_LOW
,
8
)
disp
=
ucg
.
ili9341_18x240x320_hw_spi
(
cs
,
dc
,
res
)
disp
=
ucg
.
ili9341_18x240x320_hw_spi
(
cs
,
dc
,
res
)
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